Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ __init_connection(CONN *C, URL U, CLIENT *client)
https_tunnel_response(C);
}
C->encrypt = TRUE;
if (SSL_initialize(C)==FALSE) {
if (SSL_initialize(C, url_get_hostname(U))==FALSE) {
return FALSE;
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

#include <setup.h>
#include <ssl.h>
#include <tls1.h>
#include <util.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -62,8 +63,8 @@ private void SSL_error_stack(void);
private void SSL_pthreads_locking_callback(int m, int t, char *f, int l);
#endif/*HAVE_SSL*/

BOOLEAN
SSL_initialize(CONN *C)
BOOLEAN
SSL_initialize(CONN *C, const char *servername)
{
#ifdef HAVE_SSL
int i;
Expand Down Expand Up @@ -138,6 +139,7 @@ SSL_initialize(CONN *C)
SSL_error_stack();
return FALSE;
}
SSL_ctrl(C->ssl, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, servername);
SSL_set_fd(C->ssl, C->sock);
serr = SSL_connect(C->ssl);
if (serr != 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

#endif/*HAVE_SSL*/

BOOLEAN SSL_initialize(CONN *C);
BOOLEAN SSL_initialize(CONN *C, const char *servername);
void SSL_thread_setup(void);
void SSL_thread_cleanup(void);

Expand Down