mirror of
https://github.com/proxytunnel/proxytunnel.git
synced 2026-01-23 02:34:59 +00:00
More fixes in SSL and string handling
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@148 bc163920-b10d-0410-b2c5-a5491ca2ceef
This commit is contained in:
parent
5992ea1ef8
commit
3c52e456fc
3 changed files with 12 additions and 15 deletions
19
ptstream.c
19
ptstream.c
|
|
@ -55,23 +55,22 @@ PTSTREAM *stream_open(int incoming_fd, int outgoing_fd)
|
|||
|
||||
int stream_close(PTSTREAM *pts)
|
||||
{
|
||||
/* Close the incoming fd */
|
||||
if (pts->incoming_fd != 0)
|
||||
close(pts->incoming_fd);
|
||||
|
||||
/* Close the outgoing fd */
|
||||
if (pts->outgoing_fd != 0)
|
||||
close(pts->outgoing_fd);
|
||||
|
||||
/* Destroy the SSL context */
|
||||
if (pts->ssl)
|
||||
{
|
||||
#ifdef USE_SSL
|
||||
SSL_free (pts->ssl);
|
||||
SSL_shutdown (pts->ssl);
|
||||
SSL_free (pts->ssl);
|
||||
SSL_CTX_free (pts->ctx);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Close the incoming fd */
|
||||
close(pts->incoming_fd);
|
||||
|
||||
/* Close the outgoing fd */
|
||||
close(pts->outgoing_fd);
|
||||
|
||||
/* Free the structure */
|
||||
free(pts);
|
||||
|
||||
|
|
@ -191,7 +190,7 @@ int stream_enable_ssl(PTSTREAM *pts)
|
|||
|
||||
/* Initialise the connection */
|
||||
SSLeay_add_ssl_algorithms();
|
||||
meth = SSLv2_client_method();
|
||||
meth = SSLv23_client_method();
|
||||
SSL_load_error_strings();
|
||||
|
||||
ctx = SSL_CTX_new (meth);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue