]> Nishi Git Mirror - libw3.git/commitdiff
fixing sni
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Sun, 3 Mar 2024 16:33:36 +0000 (16:33 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Sun, 3 Mar 2024 16:33:36 +0000 (16:33 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@261 d27a3e52-49c5-7645-884c-6793ebffc270

Example/fetch/fetch.c
Library/DNS.c
W3Version.h.m4

index 8b58f8c6e102009874d97a0cba04ea8bff679584..2d0d4c7aed7cc467b1cc54b31a0822c83b4d8109 100644 (file)
@@ -37,7 +37,7 @@ int main(int argc, char** argv) {
                return 1;
        }
        W3_Library_Init();
-       struct W3* w3 = W3_Create("http", argv[1], 80);
+       struct W3* w3 = W3_Create("https", argv[1], 443);
        if(w3 != NULL) {
                W3_Set_Read_Size(w3, 1024);
                W3_Set_Method(w3, argv[3] == NULL ? "GET" : argv[3]);
index 8c24b521a2a58b420db6dc84e5a2b865fffb3985..9da693d4e5da2933f4245e12c311b68acc702743 100644 (file)
@@ -88,6 +88,7 @@ int __W3_DNS_Connect(const char* hostname, bool ssl, uint16_t port
                *o_ctx = SSL_CTX_new(method);
                *o_ssl = SSL_new(*o_ctx);
                SSL_set_fd(*o_ssl, sock);
+               SSL_set_tlsext_host_name(*o_ssl, hostname);
                if(SSL_connect(*o_ssl) != 1) {
                        SSL_CTX_free(*o_ctx);
                        SSL_free(*o_ssl);
index e7bd535249264194d6b735b15d631c7165121f39..6c054cd6962f69252c3a809c75721c9d8c6eb6be 100644 (file)
@@ -6,7 +6,7 @@
 extern "C" {
 #endif
 
-#define LIBW3_VERSION "2.20C" \
+#define LIBW3_VERSION "2.20D" \
 SUFFIX
 
 ifdef(`HTTP_SUPPORT', `#define LIBW3_HTTP_SUPPORT', `')