mirror of
https://github.com/civetweb/civetweb
synced 2025-03-28 21:13:27 +00:00
mg_connect_client should set SNI for HTTPS connections
see https://github.com/civetweb/civetweb/issues/1045#issuecomment-997165735
This commit is contained in:
parent
a06ed2a769
commit
a268f2fe07
@ -37,8 +37,8 @@ main(int argc, char *argv[])
|
||||
/* Connect client */
|
||||
char errbuf[256] = {0};
|
||||
struct mg_client_options opt = {0};
|
||||
opt.host = argv[1]; /* Host name from command line */
|
||||
opt.port = 443; /* Default HTTPS port */
|
||||
opt.host = argv[1]; /* Host name from command line */
|
||||
opt.port = 443; /* Default HTTPS port */
|
||||
opt.client_cert = NULL; /* Client certificate, if required */
|
||||
opt.server_cert = NULL; /* Server certificate to verify */
|
||||
opt.host_name = opt.host; /* Host name for SNI */
|
||||
|
@ -17982,6 +17982,9 @@ mg_connect_client(const char *host,
|
||||
memset(&opts, 0, sizeof(opts));
|
||||
opts.host = host;
|
||||
opts.port = port;
|
||||
if (use_ssl) {
|
||||
opts.host_name = host;
|
||||
}
|
||||
return mg_connect_client_impl(&opts,
|
||||
use_ssl,
|
||||
error_buffer,
|
||||
|
Loading…
x
Reference in New Issue
Block a user