Hi,

Configuration:

Client -> Server
Ipsec configured for tcp connection over specific port between 2 computers.
One side is the client(1.1.1.1) that connects to server side (2.2.2.2) using TCP.
Servers listens and accept connections and doesn't initiate ipsec by itself.

After rebooting server side several times the client got stuck. IPsec connection is not established after this.

Client application gets errors:
"Conect" function returns: "Resource temporarily unavailable" for TCP socket on the client continuously.

Tail of IPsec log from the client side that initiate connection and triggers ipsec:

03:07:19  racoon: INFO: IPsec-SA established: ESP/Transport 1.1.1.1[0]->2.2.2.2[0] spi=94918873(0x5a858d9)
03:07:19  racoon: INFO: IPsec-SA established: ESP/Transport 2.2.2.2[0]->1.1.1.1[0] spi=247153556(0xebb4394)
03:07:37  racoon: INFO: purging ISAKMP-SA spi=89a46beb2ce99261:3df9516626628301.
03:07:37  racoon: INFO: purged IPsec-SA spi=247153556.
03:07:37  racoon: INFO: purged IPsec-SA spi=94918873.
03:07:37  racoon: INFO: purged ISAKMP-SA spi=89a46beb2ce99261:3df9516626628301.
03:07:37  racoon: INFO: IPsec-SA request for 1.1.1.1 queued due to no phase1 found.
03:07:37  racoon: INFO: initiate new phase 1 negotiation: 2.2.2.2[500]<=>1.1.1.1[500]
03:07:37  racoon: INFO: begin Identity Protection mode.
03:07:38  racoon: INFO: ISAKMP-SA deleted 2.2.2.2[500]-1.1.1.1[500] spi:89a46beb2ce99261:3df9516626628301
03:10:58  racoon: ERROR: phase2 negotiation failed due to time up waiting for phase1. ESP 1.1.1.1[0]->2.2.2.2[0] 
03:10:58  racoon: INFO: delete phase 2 handler.
03:10:58  racoon: INFO: request for establishing IPsec-SA was queued due to no phase1 found.
03:14:19  racoon: ERROR: phase2 negotiation failed due to time up waiting for phase1. ESP 1.1.1.1[0]->2.2.2.2[0] 
03:14:19  racoon: INFO: delete phase 2 handler.
03:14:21  racoon: INFO: request for establishing IPsec-SA was queued due to no phase1 found.
03:17:42  racoon: ERROR: phase2 negotiation failed due to time up waiting for phase1. ESP 1.1.1.1[0]->2.2.2.2[0] 
03:17:42  racoon: INFO: delete phase 2 handler.
03:17:45  racoon: INFO: request for establishing IPsec-SA was queued due to no phase1 found.
03:21:06  racoon: ERROR: phase2 negotiation failed due to time up waiting for phase1. ESP 1.1.1.1[0]->2.2.2.2[0] 
03:21:06  racoon: INFO: delete phase 2 handler.
03:21:08  racoon: INFO: request for establishing IPsec-SA was queued due to no phase1 found.
03:24:29  racoon: ERROR: phase2 negotiation failed due to time up waiting for phase1. ESP 1.1.1.1[0]->2.2.2.2[0] 
03:24:29  racoon: INFO: delete phase 2 handler.
03:24:29  racoon: INFO: request for establishing IPsec-SA was queued due to no phase1 found.

timers for phase1 and phase2 are 200 sec

What is the reason of such behaviour? What are the ways to debug this?

ipsec v.0.6.3

Thanks,

Alec