Skip to content
Permalink
Browse files

fix: do ssl handshake after socket timeout and buffer size settings (#…

  • Loading branch information
michail-nikolaev authored and davecramer committed Oct 30, 2019
1 parent 504bb31 commit e39a0be0739d016f524e7aef567f95e6ea59fd54
Showing with 3 additions and 3 deletions.
  1. +3 −3 pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java
@@ -90,9 +90,6 @@ private PGStream tryConnect(String user, String database,

PGStream newStream = new PGStream(socketFactory, hostSpec, connectTimeout);

// Construct and send an ssl startup packet if requested.
newStream = enableSSL(newStream, sslMode, info, connectTimeout);

// Set the socket timeout if the "socketTimeout" property has been set.
int socketTimeout = PGProperty.SOCKET_TIMEOUT.getInt(info);
if (socketTimeout > 0) {
@@ -134,6 +131,9 @@ private PGStream tryConnect(String user, String database,
LOGGER.log(Level.FINE, "Send Buffer Size is {0}", newStream.getSocket().getSendBufferSize());
}

// Construct and send an ssl startup packet if requested.
newStream = enableSSL(newStream, sslMode, info, connectTimeout);

List<String[]> paramList = getParametersForStartup(user, database, info);
sendStartupPacket(newStream, paramList);

0 comments on commit e39a0be

Please sign in to comment.
You can’t perform that action at this time.