/* Perform initial SSL handshake. */
SSL_set_accept_state(ssl);
- SSL_do_handshake(ssl);
- if (!SSL_is_init_finished(ssl)) {
+ if ((SSL_do_handshake(ssl) != 1) || !SSL_is_init_finished(ssl)) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02030)
"TLS upgrade handshake failed");
ssl_log_ssl_error(SSLLOG_MARK, APLOG_ERR, r->server);
modssl_set_app_data2(ssl, r);
- SSL_do_handshake(ssl);
+ if(SSL_do_handshake(ssl) != 1) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10421)
+ "TLS handshake failure");
+ ssl_log_ssl_error(SSLLOG_MARK, APLOG_ERR, r->server);
+ return HTTP_FORBIDDEN;
+ }
/* Need to trigger renegotiation handshake by reading.
* Peeking 0 bytes actually works.
* See: http://marc.info/?t=145493359200002&r=1&w=2