mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-03 13:28:44 +00:00
Improve SNI
This commit is contained in:
1 parent
31cf6f8969
commit
d327ee9834
8 files changed
+66
-40
No files matched your search
@@ -413,12 +413,15 @@ static int fetch(struct mg_mgr *mgr, char *buf, const char *url,
|
||||
ASSERT(c != NULL);
|
||||
if (mg_url_is_ssl(url)) {
|
||||
struct mg_tls_opts opts;
|
||||
struct mg_str host = mg_url_host(url);
|
||||
memset(&opts, 0, sizeof(opts));
|
||||
opts.ca = "./test/data/ca.pem";
|
||||
if (strstr(url, "127.0.0.1") != NULL) {
|
||||
// Local connection, use self-signed certificates
|
||||
opts.ca = "./test/data/ss_ca.pem";
|
||||
opts.cert = "./test/data/ss_client.pem";
|
||||
} else {
|
||||
opts.srvname = host;
|
||||
}
|
||||
mg_tls_init(c, &opts);
|
||||
// c->is_hexdumping = 1;
|
||||
|
||||
Reference in new issue
Block a user