Skip to content

SSL handshake stuck forever #1822

@iobestar

Description

@iobestar

Describe the issue
org.postgresql.ssl.MakeSSL#convert stuck forever in case of network failure in terms of packet loss. SoTimeout is not set and by default is 0 (forever).

Driver Version?
42.2.9

Java Version?
11
OS Version?

PostgreSQL Version?
11
To Reproduce
Steps to reproduce the behaviour:
Simulate packet loss after connection in org.postgresql.ssl.MakeSSL#convert is established.

Expected behaviour
SocketTimeoutException should be thrown.

Stack trace

Default connection adder [29291022] (RUNNABLE)
   java.net.SocketInputStream.socketRead0 line: not available [native method]
   java.net.SocketInputStream.socketRead line: 115 
   java.net.SocketInputStream.read line: 168 
   java.net.SocketInputStream.read line: 140 
   sun.security.ssl.SSLSocketInputRecord.read line: 448 
   sun.security.ssl.SSLSocketInputRecord.decodeInputRecord line: 237 
   sun.security.ssl.SSLSocketInputRecord.decode line: 190 
   sun.security.ssl.SSLTransport.decode line: 108 
   sun.security.ssl.SSLSocketImpl.decode line: 1152 
   sun.security.ssl.SSLSocketImpl.readHandshakeRecord line: 1063 
   sun.security.ssl.SSLSocketImpl.startHandshake line: 402 
   org.postgresql.ssl.MakeSSL.convert line: 40 
   org.postgresql.core.v3.ConnectionFactoryImpl.enableSSL line: 441 
   org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect line: 135 
   org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl line: 192 
   org.postgresql.core.ConnectionFactory.openConnection line: 49 
   org.postgresql.jdbc.PgConnection.<init> line: 211 
   org.postgresql.Driver.makeConnection line: 458 
   org.postgresql.Driver.connect line: 260 
   com.zaxxer.hikari.util.DriverDataSource.getConnection line: 138 
   com.zaxxer.hikari.pool.PoolBase.newConnection line: 354 
   com.zaxxer.hikari.pool.PoolBase.newPoolEntry line: 202 
   com.zaxxer.hikari.pool.HikariPool.createPoolEntry line: 473 
   com.zaxxer.hikari.pool.HikariPool.access$100 line: 71 
   com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call line: 719 
   com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call line: 705 
   java.util.concurrent.FutureTask.run line: 264 
   java.util.concurrent.ThreadPoolExecutor.runWorker line: 1128 
   java.util.concurrent.ThreadPoolExecutor$Worker.run line: 628 
   java.lang.Thread.run line: 834 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions