if( "tcp".equals(scheme) ) { transport = new TcpTransport(); } else if( SslTransport.protocol(scheme)!=null ) { SslTransport ssl = new SslTransport(); if( mqtt.sslContext == null ) { mqtt.sslContext = SSLContext.getDefault(); ssl.setSSLContext(mqtt.sslContext); transport = ssl; } else {
protected TcpTransport createTransport() { SslTransport rc = new SslTransport(); rc.setDispatchQueue(dispatchQueue); rc.setBlockingExecutor(blockingExecutor); rc.setSSLContext(sslContext); rc.setClientAuth(clientAuth); rc.setDisabledCypherSuites(disabledCypherSuites); return rc; }
/** * Allows subclasses of TcpTransportFactory to create custom instances of * TcpTransport. */ protected TcpTransport createTransport(URI uri) throws Exception { String protocol = protocol(uri.getScheme()); if( protocol !=null ) { SslTransport rc = new SslTransport(); rc.setSSLContext(SSLContext.getInstance(protocol)); return rc; } return null; }
public void handshake() { try { if( !transportFlush() ) { return; secure_write(ByteBuffer.allocate(0)); break; if( secure_read(ByteBuffer.allocate(0)) == -1) { throw new EOFException("Peer disconnected during ssl handshake"); onTransportFailure(e); } finally { if( engine.getHandshakeStatus() == NOT_HANDSHAKING ) {
public SslTransportServer(URI location) throws Exception { super(location); setSSLContext(SSLContext.getInstance(SslTransport.protocol(location.getScheme()))); }
public void run() { handshake(); } });
public boolean isOpen() { return getSocketChannel().isOpen(); }
final TcpTransport transport; if( options.getSslContext() !=null ) { SslTransport ssl = new SslTransport(); ssl.setSSLContext(options.getSslContext()); transport = ssl; } else {
public void run() { handshake(); } });
public void close() throws IOException { getSocketChannel().close(); }
/** * Allows subclasses of TcpTransportFactory to create custom instances of * TcpTransport. */ public static SslTransport createTransport(URI uri) throws Exception { String protocol = protocol(uri.getScheme()); if( protocol !=null ) { SslTransport rc = new SslTransport(); rc.setSSLContext(SSLContext.getInstance(protocol)); return rc; } return null; }
@Override public void flush() { if ( engine.getHandshakeStatus()!=NOT_HANDSHAKING ) { handshake(); } else { super.flush(); } }
if( "tcp".equals(scheme) ) { transport = new TcpTransport(); } else if( SslTransport.protocol(scheme)!=null ) { SslTransport ssl = new SslTransport(); if( mqtt.sslContext == null ) { mqtt.sslContext = SSLContext.getDefault(); ssl.setSSLContext(mqtt.sslContext); transport = ssl; } else {
@Override public void drainInbound() { if ( engine.getHandshakeStatus()!=NOT_HANDSHAKING ) { handshake(); } else { super.drainInbound(); } }
if( "tcp".equals(scheme) ) { transport = new TcpTransport(); } else if( SslTransport.protocol(scheme)!=null ) { SslTransport ssl = new SslTransport(); if( sslContext == null ) { sslContext = SSLContext.getDefault(); ssl.setSSLContext(sslContext); transport = ssl; } else {
@Override protected void onConnected() throws IOException { super.onConnected(); engine.beginHandshake(); handshake(); }
if( "tcp".equals(scheme) ) { transport = new TcpTransport(); } else if( SslTransport.protocol(scheme)!=null ) { SslTransport ssl = new SslTransport(); if( sslContext == null ) { sslContext = SSLContext.getDefault(); ssl.setSSLContext(sslContext); transport = ssl; } else {