code: public void upgradeToSecure() throws IOException {
          Options options = this.connection.getOptions();
          SSLContext context = options.getSslContext();
          
          SSLSocketFactory factory = context.getSocketFactory();
          Duration timeout = options.getConnectionTimeout();
  
          this.sslSocket = (SSLSocket) factory.createSocket(socket, null, true);
          this.sslSocket.setUseClientMode(true);
  
          final CompletableFuture<Void> waitForHandshake = new CompletableFuture<>();
          
          this.sslSocket.addHandshakeCompletedListener((evt) -> {
              waitForHandshake.complete(null);
          }
docs: Upgrade the port to SSL. If it is already secured, this is a no-op.
  If the data port type doesn't support SSL it should throw an exception.