/** * Fire a counter incrementation event. * @param e CounterEvent */ protected void fireIncrementCounter(CounterEvent e) { if (counterSupport != null) { counterSupport.fireIncrementCounter(e); } }
/** * Fire a counter incrementation event. * @param e CounterEvent */ protected void fireIncrementCounter(CounterEvent e) { if (counterSupport != null) { counterSupport.fireIncrementCounter(e); } }
/** * Fire a counter incrementation event. * @param e CounterEvent */ protected void fireIncrementCounter(CounterEvent e) { if (counterSupport != null) { counterSupport.fireIncrementCounter(e); } }
protected void fireIncrementCounter(CounterEvent e) { counterSupport.fireIncrementCounter(e); }
protected void fireIncrementCounter(CounterEvent e) { counterSupport.fireIncrementCounter(e); }
protected void fireIncrementCounter(CounterEvent e) { counterSupport.fireIncrementCounter(e); }
protected void fireIncrementCounter(CounterEvent e) { counterSupport.fireIncrementCounter(e); }
protected void fireIncrementCounter(CounterEvent e) { counterSupport.fireIncrementCounter(e); }
protected void fireIncrementCounter(CounterEvent e) { counterSupport.fireIncrementCounter(e); }
@Override public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { if (checkClientTrustedIntern(x509Certificates)) return; try { trustManager.checkClientTrusted(x509Certificates, s); } catch (CertificateException cex) { tlstmCounters.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionOpenErrors)); tlstmCounters.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionInvalidClientCertificates)); logger.warn("Client certificate validation failed for '"+x509Certificates[0]+"'"); throw cex; } }
public void responseReceived() { this.responseReceived = true; if (waitTime != null) { CounterSupport counterSupport = getCounterSupport(); if (counterSupport != null) { long increment = (System.nanoTime()-waitTime.getIncrement())/SnmpConstants.MILLISECOND_TO_NANOSECOND; waitTime.setIncrement(increment); counterSupport.fireIncrementCounter(waitTime); if (waitTimeTarget != null) { waitTimeTarget.setIncrement(increment); counterSupport.fireIncrementCounter(waitTimeTarget); } } } }
public void responseReceived() { this.responseReceived = true; if (waitTime != null) { CounterSupport counterSupport = getCounterSupport(); if (counterSupport != null) { long increment = (System.nanoTime() - waitTime.getIncrement()) / SnmpConstants.MILLISECOND_TO_NANOSECOND; waitTime.setIncrement(increment); counterSupport.fireIncrementCounter(waitTime); if (waitTimeTarget != null) { waitTimeTarget.setIncrement(increment); counterSupport.fireIncrementCounter(waitTimeTarget); } } } }
@Override public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { if (preCheckServerTrusted(x509Certificates)) return; try { trustManager.checkServerTrusted(x509Certificates, s); } catch (CertificateException cex) { tlstmCounters.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionOpenErrors)); tlstmCounters.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionUnknownServerCertificate)); logger.warn("Server certificate validation failed for '"+x509Certificates[0]+"'"); throw cex; } postCheckServerTrusted(x509Certificates); }
@Override public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { if (checkClientTrustedIntern(x509Certificates)) return; try { trustManager.checkClientTrusted(x509Certificates, s); } catch (CertificateException cex) { tlstm.getCounterSupport().fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionOpenErrors)); tlstm.getCounterSupport().fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionInvalidClientCertificates)); logger.warn("Client certificate validation failed for '"+x509Certificates[0]+"'"); throw cex; } }
@Override public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { if (preCheckServerTrusted(x509Certificates)) return; try { trustManager.checkServerTrusted(x509Certificates, s); } catch (CertificateException cex) { tlstm.getCounterSupport().fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionOpenErrors)); tlstm.getCounterSupport().fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionUnknownServerCertificate)); logger.warn("Server certificate validation failed for '"+x509Certificates[0]+"'"); throw cex; } postCheckServerTrusted(x509Certificates); }
public SocketEntry(TcpAddress address, Socket socket, boolean useClientMode, TransportStateReference tmStateReference) throws NoSuchAlgorithmException { this.inAppBuffer = ByteBuffer.allocate(getMaxInboundMessageSize()); this.inNetBuffer = ByteBuffer.allocate(getMaxInboundMessageSize()); this.outNetBuffer = ByteBuffer.allocate(getMaxInboundMessageSize()); this.peerAddress = address; this.tmStateReference = tmStateReference; this.socket = socket; this.lastUse = System.nanoTime(); if (tmStateReference == null) { counterSupport.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionAccepts)); } SSLContext sslContext = sslEngineConfigurator.getSSLContext(useClientMode, tmStateReference); this.sslEngine = sslContext.createSSLEngine(address.getInetAddress().getHostName(), address.getPort()); sslEngine.setUseClientMode(useClientMode); // sslEngineConfigurator.configure(SSLContext.getDefault(), useClientMode); sslEngineConfigurator.configure(sslEngine); synchronized (TLSTM.this) { sessionID = nextSessionID++; } }
public void closeSession() { try { SSLEngineResult result; do { result = sendNetMessage(this); } while (result != null && (result.getStatus() != SSLEngineResult.Status.CLOSED) && (result.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NEED_WRAP)); } catch (IOException e) { if (logger.isDebugEnabled()) { logger.debug("IOException while closing outbound channel of " + this + ": " + e.getMessage()); } } sslEngine.closeOutbound(); counterSupport.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionServerCloses)); } }
public SocketEntry(TcpAddress address, Socket socket, boolean useClientMode, TransportStateReference tmStateReference) throws NoSuchAlgorithmException { super(address, socket); this.inAppBuffer = ByteBuffer.allocate(getMaxInboundMessageSize()); this.inNetBuffer = ByteBuffer.allocate(getMaxInboundMessageSize()); this.outNetBuffer = ByteBuffer.allocate(getMaxInboundMessageSize()); this.tmStateReference = tmStateReference; if (tmStateReference == null) { counterSupport.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionAccepts)); } SSLEngineConfigurator sslEngineConfigurator = ensureSslEngineConfigurator(); SSLContext sslContext = sslEngineConfigurator.getSSLContext(useClientMode, tmStateReference); this.sslEngine = sslContext.createSSLEngine(address.getInetAddress().getHostName(), address.getPort()); sslEngine.setUseClientMode(useClientMode); sslEngineConfigurator.configure(sslEngine); synchronized (TLSTM.this) { sessionID = nextSessionID++; } }
@Override public void checkServerTrusted(X509Certificate[] x509Certificates, String s, SSLEngine sslEngine) throws CertificateException { logger.debug("checkServerTrusted with sslEngine"); if (preCheckServerTrusted(x509Certificates)) return; try { if (trustManager instanceof X509ExtendedTrustManager) { logger.debug("extended checkServerTrusted with sslEngine"); ((X509ExtendedTrustManager)trustManager).checkServerTrusted(x509Certificates, s, sslEngine); } else { trustManager.checkServerTrusted(x509Certificates, s); } } catch (CertificateException cex) { tlstmCounters.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionOpenErrors)); tlstmCounters.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionUnknownServerCertificate)); logger.warn("Server certificate validation failed for '"+x509Certificates[0]+"'"); throw cex; } postCheckServerTrusted(x509Certificates); }
@Override public void checkClientTrusted(X509Certificate[] x509Certificates, String s, SSLEngine sslEngine) throws CertificateException { logger.debug("checkClientTrusted with sslEngine"); if (checkClientTrustedIntern(x509Certificates)) return; try { if (trustManager instanceof X509ExtendedTrustManager) { logger.debug("extended checkClientTrusted with sslEngine"); ((X509ExtendedTrustManager)trustManager).checkClientTrusted(x509Certificates, s, sslEngine); } else { trustManager.checkClientTrusted(x509Certificates, s); } } catch (CertificateException cex) { tlstm.getCounterSupport().fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionOpenErrors)); tlstm.getCounterSupport().fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionInvalidClientCertificates)); logger.warn("Client certificate validation failed for '"+x509Certificates[0]+"'"); throw cex; } }