
Ssl = SSL_new(ctx) /* get new SSL state with context */ Wait before close connection to check max connections error

Printf("Connection: %s:%d\n",inet_ntoa(addr.sin_addr), ntohs(addr.sin_port)) Int client = accept(server, (struct sockaddr*)&addr, &len) /* accept connection as usual */ Server = OpenListener(atoi(portnum)) /* create server socket */ LoadCertificates(ctx, "mycert.pem", "mycert.pem") /* load certs */ Printf("This program must be run as root/sudo user!!") Ĭtx = InitServerCTX() /* initialize SSL */ Sd = SSL_get_fd(ssl) /* get socket connection */ SSL_write(ssl, reply, strlen(reply)) /* send reply */ Sprintf(reply, HTMLecho, buf) /* construct reply */ ShowCerts(ssl) /* get any certificates */īytes = SSL_read(ssl, buf, sizeof(buf)) /* get request */ If ( SSL_accept(ssl) = FAIL ) /* do SSL-protocol accept */ If ( SSL_CTX_use_certificate_file(ctx, CertFile, SSL_FILETYPE_PEM) %s\n\n" * set the local certificate from CertFile */ Void LoadCertificates(SSL_CTX* ctx, char* CertFile, char* KeyFile) Method = SSLv3_server_method() /* create new server-method instance */Ĭtx = SSL_CTX_new(method) /* create new context from method */ SSL_load_error_strings() /* load all error messages */

OpenSSL_add_all_algorithms() /* load & register all cryptos, etc. Perror("Can't configure listening port") If ( bind(sd, (struct sockaddr*)&addr, sizeof(addr)) != 0 ) From Wireshark log i can see the number of retries for client hello is 10. I tried changing /proc/sys/net/ipv4/tcp_retries2 but it doesn't effect the number of retries. Below are the ssl-server and ssl-client downloaded.

I'm doing this on linux ubuntu 14.04 x86. I'm trying to understand the reason and source of this retransmission. When i try to analyse wireshark log i can seen "Client Hello TCP retramission" message 10 times. After approx 2 minutes i'm getting SSL error and client returns as expected. I'm trying to create server busy by adding delay in the SSL Server code(given below) before accept(), then from the SSL client trying to connect to server.
