private void negotiateSSLConnection(String user,String password,String database,int packLength) throws SQLException {
  if (!ExportControlled.enabled()) {
    throw new ConnectionFeatureNotAvailableException(this.connection,this.lastPacketSentTimeMs,null);
  }
  if ((this.serverCapabilities & CLIENT_SECURE_CONNECTION) != 0) {
    this.clientParam|=CLIENT_SECURE_CONNECTION;
  }
  this.clientParam|=CLIENT_SSL;
  Buffer packet=new Buffer(packLength);
  if (this.use41Extensions) {
    packet.writeLong(this.clientParam);
    packet.writeLong(this.maxThreeBytes);
    appendCharsetByteForHandshake(packet,getEncodingForHandshake());
    packet.writeBytesNoNull(new byte[23]);
  }
 else {
    packet.writeInt((int)this.clientParam);
  }
  send(packet,packet.getPosition());
  ExportControlled.transformSocketToSSLSocket(this);
}

private void negotiateSSLConnection ( String user , String password , String database , int packLength ) throws SQLException { if ( ! ExportControlled . enabled ( ) ) { throw new ConnectionFeatureNotAvailableException ( this . connection , this . lastPacketSentTimeMs , null ) ; } if ( ( this . serverCapabilities & CLIENT_SECURE_CONNECTION ) != 0 ) { this . clientParam |= CLIENT_SECURE_CONNECTION ; } this . clientParam |= CLIENT_SSL ; Buffer packet = new Buffer ( packLength ) ; if ( this . use41Extensions ) { packet . writeLong ( this . clientParam ) ; packet . writeLong ( this . maxThreeBytes ) ; appendCharsetByteForHandshake ( packet , getEncodingForHandshake ( ) ) ; packet . writeBytesNoNull ( new byte [ 23 ] ) ; } else { packet . writeInt ( ( int ) this . clientParam ) ; } send ( packet , packet . getPosition ( ) ) ; ExportControlled . transformSocketToSSLSocket ( this ) ; }
negotiates the ssl communications channel used when connecting to a mysql server that understands ssl .
