The SO_LINGER time is documented here.
The SO_LINGER time (in seconds) at the service providing security server end for connections between security servers. A value larger than 0 means that upon closing a connection, the system will allow SO_LINGER seconds for the transmission and acknowledgement of all data written to the peer, at which point the socket is closed gracefully. Upon reaching the linger timeout, the socket is closed forcefully, with a TCP RST. Enabling the option with a timeout of zero does a forceful close immediately. Value of -1 disables the forceful close.
Default configuration (/etc/xroad/conf.d/proxy.ini):
; Connector socket SO_LINGER timeout in seconds of Client Proxy, value of -1 means off
client-connector-so-linger=-1
; HTTP client socket SO_LINGER timeout in seconds of Client Proxy, value of -1 means off
client-httpclient-so-linger=-1
; Connector socket SO_LINGER timeout in seconds of Server Proxy, value of -1 means off
server-connector-so-linger=-1
It has been reported that TLS is ended with RST, ACK when the SO_LINGER value is -1. According to the documentation, a SO_LINGER value of -1 should disable the forceful close.
The JIRA ticket this issue was created from can be found here: https://nordic-institute.atlassian.net/browse/XRDDEV-49
Acceptance criteria:
The SO_LINGER related properties and socket closing behaviour is tested using different property values (-1, 0, 1)
The behaviour is fixed to match the documentation