<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — Error in using curl and wolfssl to implement HTTPS]]></title>
		<link>https://www.wolfssl.com/forums/topic1649-error-in-using-curl-and-wolfssl-to-implement-https.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1649.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Error in using curl and wolfssl to implement HTTPS.]]></description>
		<lastBuildDate>Thu, 17 Dec 2020 19:38:41 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Error in using curl and wolfssl to implement HTTPS]]></title>
			<link>https://www.wolfssl.com/forums/post5650.html#p5650</link>
			<description><![CDATA[<p>I&#039;ve been able to reproduce and saw that a different certificates are being returned.</p><p>Building wolfSSL with </p><div class="codebox"><pre><code>--enable-sni</code></pre></div><p> should address this. This includes the server name in the Client Hello so the server will send the appropriate certificate.</p><br /><p>Hope that addresses your issue.</p><p><strong>Details</strong><br />Using wireshark I captured the certificates when running</p><div class="codebox"><pre><code>curl -vvI https://qnzthome.51110.com/ --tls-max 1.2
./examples/client/client -h qnzthome.51110.com -p 443 -A /etc/ssl/certs/DigiCert_Global_Root_CA.pem -m -v3</code></pre></div><p>I saw the same certificate in gdb using the example program you had shared with TLS v1.3.</p><p>Note if you test with the example client you will need add -S<br /></p><div class="codebox"><pre><code>./examples/client/client -h qnzthome.51110.com -p 443 -A /etc/ssl/certs/DigiCert_Global_Root_CA.pem -m -v3 -S qnzthome.51110.com</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Thu, 17 Dec 2020 19:38:41 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post5650.html#p5650</guid>
		</item>
		<item>
			<title><![CDATA[Re: Error in using curl and wolfssl to implement HTTPS]]></title>
			<link>https://www.wolfssl.com/forums/post5649.html#p5649</link>
			<description><![CDATA[<div class="quotebox"><cite>jeff wrote:</cite><blockquote><p>Hi Joe,</p><p>It looks like you are using a current version of curl. wolfSSL is currently at version 4.5 (3.13 is 3 years old). Is it possible for you to try with a more recent version of wolfSSL?</p></blockquote></div><p>Hi jeff，<br />Thanks for your response.<br />I also realized this problem after posting. But I tried the latest version of wolfssl（4.5.0）, and it&#039;s the same thing.<br />Do you have any other ideas, such as the configuration option, is there anything wrong？<br />PS: I tried </p><div class="codebox"><pre><code>curl_ easy_ setopt(curl,CURLOPT_ SSL_ Verifyhost, 2L);</code></pre></div><p> change to </p><div class="codebox"><pre><code>curl_ easy_ setopt(curl,CURLOPT_ SSL_ Verifyhost, 0L);</code></pre></div><p> it can work normally.But I need to verify the domain name.</p>]]></description>
			<author><![CDATA[null@example.com (Joe)]]></author>
			<pubDate>Thu, 17 Dec 2020 01:19:21 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post5649.html#p5649</guid>
		</item>
		<item>
			<title><![CDATA[Re: Error in using curl and wolfssl to implement HTTPS]]></title>
			<link>https://www.wolfssl.com/forums/post5648.html#p5648</link>
			<description><![CDATA[<p>Hi Joe,</p><p>It looks like you are using a current version of curl. wolfSSL is currently at version 4.5 (3.13 is 3 years old). Is it possible for you to try with a more recent version of wolfSSL?</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Wed, 16 Dec 2020 18:10:20 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post5648.html#p5648</guid>
		</item>
		<item>
			<title><![CDATA[Error in using curl and wolfssl to implement HTTPS]]></title>
			<link>https://www.wolfssl.com/forums/post5643.html#p5643</link>
			<description><![CDATA[<p>Hi everyone,<br />I am trying to use curl + wolfssl to implement HTTPS on arm linux, but there was an error.<br />When I use curl + OpenSSL to test the same code, there is no problem at all.</p><p>Curl version ：7.74.0<br />Wolfsll version : 3.13.0<br />Openssl version ：1.1.1.1i</p><p>The error message is as follows:<br />==========================================================<br />[1]About to verify certificate signature<br />[1]Verified Peer&#039;s cert<br />[1]DomainName match on common name failed<br />[1]Checking AltNames<br />[1]&nbsp; &nbsp; &nbsp;individual AltName check<br />[1]&nbsp; &nbsp; &nbsp;individual AltName check<br />[1]&nbsp; &nbsp; &nbsp;individual AltName check<br />[1]&nbsp; &nbsp; &nbsp;individual AltName check<br />[1]&nbsp; &nbsp; &nbsp;individual AltName check<br />[1]&nbsp; &nbsp; &nbsp;individual AltName check<br />[1]&nbsp; &nbsp; &nbsp;individual AltName check<br />[1]&nbsp; &nbsp; &nbsp;individual AltName check<br />[1]&nbsp; &nbsp; &nbsp;individual AltName check<br />[1]&nbsp; &nbsp; &nbsp;individual AltName check<br />[1]DomainName match on alt names failed too<br />[1]growing output buffer</p><p>[1]Shrinking output buffer</p><p>[0]wolfSSL error occurred, error = 322 line:8854 file:src/ssl.c<br />*&nbsp; &nbsp; &nbsp; &nbsp;subject alt name(s) or common name do not match &quot;qnzthome.51110.com&quot;</p><p>[1]CTX ref count not 0 yet, no free<br />[1]Shrinking input buffer</p><p>[1]CTX ref count down to 0, doing full free</p><p>==========================================================</p><br /><p>Part of my test code is as follows:<br />==========================================================<br /></p><div class="codebox"><pre><code>#define TEST_URL &quot;[url]https://qnzthome.51110.com/[/url]&quot;

int total_size = 0;

static size_t save_response_callback(void *buffer,size_t size,size_t count,void *file_fp)
{
    printf(&quot;recv data size :%d, %d byte\n&quot;, size, count);
   
    total_size += (size * count);
    return fwrite((char *)buffer, 1, count, (FILE *)file_fp);
}
 
void log_printf(const int level, const char *message)
{
    if(NULL == message) return;
    if(level &lt;= 1)
     printf(&quot;[%d]%s\n&quot;,level, message);
}

int main(int argc,char *argv[])
{
    CURL * curl;
    CURLcode res;
        

    curl_global_init(CURL_GLOBAL_DEFAULT);
 
    curl_version_info_data *info = curl_version_info(CURLVERSION_NOW);// no need for NULL check
    
    int index = 0;
    while(strlen(info-&gt;protocols[index]) != 0)
    {
        printf(&quot;%s &quot;, info-&gt;protocols[index]);
        index++;
        if(info-&gt;protocols[index] == NULL)
            break;
    }
    printf(&quot;\n version:%s, ssl version :%s\n&quot;, info-&gt;version, info-&gt;ssl_version);
    
    FILE *fp = fopen(&quot;/tmp/nfs/pic.jpg&quot;, &quot;w+&quot;);
    
    curl = curl_easy_init();
   
    wolfSSL_SetLoggingCb(log_printf);
    wolfSSL_Debugging_ON();

    char errbuf[CURL_ERROR_SIZE];

    if(curl!=NULL){
        printf(&quot;URL &lt;%s&gt;\n&quot;,TEST_URL);
        
        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);

        curl_easy_setopt(curl,CURLOPT_URL,TEST_URL);
        curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,&amp;save_response_callback);
        curl_easy_setopt(curl,CURLOPT_WRITEDATA,(void *)fp);
        curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1L);
        
        curl_easy_setopt(curl,CURLOPT_CAINFO,&quot;/tmp/nfs/cacert-1.pem&quot;);
 
        curl_easy_setopt(curl,CURLOPT_SSL_VERIFYHOST, 2L);
        curl_easy_setopt(curl,CURLOPT_VERBOSE,1);
        curl_easy_setopt(curl,CURLOPT_TIMEOUT,30);
 
        res = curl_easy_perform(curl);
        printf(&quot;res : %d, total size %d\n&quot;, res, total_size);
        if(res != CURLE_OK){
 
             printf(&quot;curl_easy_perform error = %s, %s\n&quot;,curl_easy_strerror(res), errbuf);
        }
        curl_easy_cleanup(curl);
    }
    fclose(fp);
}</code></pre></div><p>==========================================================</p><br /><br /><br /><p>When porting wolfssl, the configuration is as follows：<br />==========================================================<br />./configure --host=${host} --prefix=${wolfssl_path}/wolfssl-3.13.0/install/ --disable-shared --enable-static --enable-tls13 --enable-ecc --enable-debug<br />==========================================================</p><br /><p>Curl is configured as follows:<br />==========================================================<br />./configure --prefix=$(pwd)/install/${arch} --build=i686-pc-linux-gnu --host=${host} --enable-optimize --disable-werror --enable-ares=${cares_path}/lib/lib/lib/c-ares-1.17.1/install --enable-shared=no --enable-static=yes --enable-libgcc --disable-ipv6 --enable-versioned-symbols --enable-threaded-resolver --enable-pthreads --disable-verbose --enable-unix-sockets --without-zlib&nbsp; CFLAGS=-fPIC CPPFLAGS=-fPIC --disable-tftp --disable-ftp --disable-telnet --disable-pop3 --disable-imap --disable-mqtt -disable-smtp --disable-rtsp --disable-smb --with-wolfssl --without-ssl<br />==========================================================</p><br /><p>Please give some clues to help me solve my problems</p><p>Thanks in advance</p>]]></description>
			<author><![CDATA[null@example.com (Joe)]]></author>
			<pubDate>Wed, 16 Dec 2020 09:26:37 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post5643.html#p5643</guid>
		</item>
	</channel>
</rss>
