mirror of
https://github.com/proxytunnel/proxytunnel.git
synced 2026-01-23 02:34:59 +00:00
Error handling on SSL_new and SSL_connect
This commit is contained in:
parent
ab33f01fbd
commit
69c48599e4
2 changed files with 14 additions and 1 deletions
|
|
@ -309,6 +309,10 @@ int stream_enable_ssl(PTSTREAM *pts, const char *proxy_arg) {
|
|||
}
|
||||
|
||||
ssl = SSL_new (ctx);
|
||||
if ( ssl == NULL ) {
|
||||
message("SSL_new failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
SSL_set_rfd (ssl, stream_get_incoming_fd(pts));
|
||||
SSL_set_wfd (ssl, stream_get_outgoing_fd(pts));
|
||||
|
|
@ -334,7 +338,10 @@ int stream_enable_ssl(PTSTREAM *pts, const char *proxy_arg) {
|
|||
exit( 1 );
|
||||
}
|
||||
|
||||
SSL_connect (ssl);
|
||||
if ( SSL_connect (ssl) <= 0) {
|
||||
message( "SSL_connect failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ( !args_info.no_check_cert_flag ) {
|
||||
/* Make sure peer presented a certificate */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue