<?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 — [SOLVED] "SSL version error" while connecting to server]]></title>
		<link>https://www.wolfssl.com/forums/topic1225-solved-ssl-version-error-while-connecting-to-server.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1225.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [SOLVED] "SSL version error" while connecting to server.]]></description>
		<lastBuildDate>Mon, 27 Aug 2018 21:47:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED] "SSL version error" while connecting to server]]></title>
			<link>https://www.wolfssl.com/forums/post4113.html#p4113</link>
			<description><![CDATA[<p>Pilatuz,</p><p>Your solution is the correct one. Turn on &quot;Server Name Indication&quot; extension by defining HAVE_SNI or by configuring with --enable-sni. Then from your application call:</p><div class="codebox"><pre><code>int ret = -1;
char error_buf[WOLFSSL_MAX_ERROR_SZ];
char* hostName = &quot;&lt;The host name of the target server&gt;&quot;; // Example: &quot;google.com&quot;

if ( (ret = wolfSSL_CTX_UseSNI(ctx, WOLFSSL_SNI_HOST_NAME, hostName, XSTRLEN(hostName))) != WOLFSSL_SUCCESS) {
    printf(&quot;Setting host name failed with error condition: %d and reason %s\n&quot;, ret, wolfSSL_ERR_error_string(ret, error_buf));
}</code></pre></div><p>- Kaleb</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Mon, 27 Aug 2018 21:47:16 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post4113.html#p4113</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] "SSL version error" while connecting to server]]></title>
			<link>https://www.wolfssl.com/forums/post4007.html#p4007</link>
			<description><![CDATA[<p>It seems that SNI should be enabled to make connection to that server works.</p>]]></description>
			<author><![CDATA[null@example.com (Pilatuz)]]></author>
			<pubDate>Sun, 17 Jun 2018 07:19:32 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post4007.html#p4007</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED] "SSL version error" while connecting to server]]></title>
			<link>https://www.wolfssl.com/forums/post4005.html#p4005</link>
			<description><![CDATA[<p>Hello, I&#039;m trying to get response from <a href="https://reqres.in/">https://reqres.in/</a> test REST server. But during handshake just after Hello Client message I get Alert response from server and handshake fails with -326 &quot;SSL version error&quot;. How to find the reason of this error? And how to fix it?</p><p>I use the latest 3.15.0-stable code:<br /></p><div class="codebox"><pre><code>$ git describe 
v3.15.0-stable</code></pre></div><p>Library is configured with default flags:<br /></p><div class="codebox"><pre><code>$ ./configure --enable-debug </code></pre></div><p>Then the client example shows:<br /></p><div class="codebox"><pre><code>$ ~/wolfssl/examples/client/client -g -h reqres.in -p 443 -A /etc/ssl/certs/USERTrust_RSA_Certification_Authority.pem
wolfSSL Entering wolfSSL_Init
wolfSSL Entering wolfCrypt_Init
wolfSSL Entering WOLFSSL_CTX_new_ex
wolfSSL Entering wolfSSL_CertManagerNew
wolfSSL Leaving WOLFSSL_CTX_new, return 0
wolfSSL Entering wolfSSL_CTX_use_certificate_chain_file
Getting dynamic buffer
wolfSSL Entering PemToDer
Checking cert signature type
wolfSSL Entering GetExplicitVersion
wolfSSL Entering GetSerialNumber
Got Cert Header
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
Got Algo ID
Getting Cert Name
Getting Cert Name
Got Subject Name
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
Got Key
Not ECDSA cert signature
wolfSSL Entering wolfSSL_CTX_use_PrivateKey_file
Getting dynamic buffer
wolfSSL Entering PemToDer
wolfSSL Entering wolfSSL_CTX_load_verify_locations
Getting dynamic buffer
Processing CA PEM file
wolfSSL Entering PemToDer
Adding a CA
wolfSSL Entering GetExplicitVersion
wolfSSL Entering GetSerialNumber
Got Cert Header
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
Got Algo ID
Getting Cert Name
Getting Cert Name
Got Subject Name
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
Got Key
Parsed Past Key
wolfSSL Entering DecodeCertExtensions
wolfSSL Entering GetObjectId()
wolfSSL Entering DecodeSubjKeyId
wolfSSL Entering GetObjectId()
wolfSSL Entering DecodeKeyUsage
wolfSSL Entering GetObjectId()
wolfSSL Entering DecodeBasicCaConstraint
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
    Parsed new CA
    Freeing Parsed CA
    Freeing der CA
        OK Freeing der CA
wolfSSL Leaving AddCA, return 0
   Processed a CA
Processed at least one valid CA. Other stuff OK
wolfSSL Entering wolfSSL_CTX_load_verify_locations
Getting dynamic buffer
Processing CA PEM file
wolfSSL Entering PemToDer
Adding a CA
wolfSSL Entering GetExplicitVersion
wolfSSL Entering GetSerialNumber
Got Cert Header
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
Got Algo ID
Getting Cert Name
Getting Cert Name
Got Subject Name
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
wolfSSL Entering GetObjectId()
Got Key
Parsed Past Key
wolfSSL Entering DecodeCertExtensions
wolfSSL Entering GetObjectId()
wolfSSL Entering DecodeBasicCaConstraint
wolfSSL Entering GetObjectId()
wolfSSL Entering GetObjectId()
wolfSSL Entering DecodeSubjKeyId
wolfSSL Entering GetObjectId()
wolfSSL Entering DecodeAuthKeyId
wolfSSL Entering GetObjectId()
wolfSSL Entering DecodeKeyUsage
wolfSSL Entering GetObjectId()
wolfSSL Entering DecodeExtKeyUsage
wolfSSL Entering GetObjectId()
wolfSSL Entering GetAlgoId
wolfSSL Entering GetObjectId()
    Parsed new CA
    Freeing Parsed CA
    Freeing der CA
        OK Freeing der CA
wolfSSL Leaving AddCA, return 0
   Processed a CA
Processed at least one valid CA. Other stuff OK
wolfSSL Entering SSL_new
wolfSSL Leaving SSL_new, return 0
wolfSSL Entering SSL_set_fd
wolfSSL Entering SSL_set_read_fd
wolfSSL Leaving SSL_set_read_fd, return 1
wolfSSL Entering SSL_set_write_fd
wolfSSL Leaving SSL_set_write_fd, return 1
wolfSSL Entering SSL_connect()
wolfSSL Entering SendClientHello
Adding signature algorithms extension
growing output buffer

Signature Algorithms extension to write
Point Formats extension to write
Supported Groups extension to write
Shrinking output buffer

wolfSSL Leaving SendClientHello, return 0
connect state: CLIENT_HELLO_SENT
SSL version error
wolfSSL error occurred, error = -326
wolfSSL Entering SSL_get_error
wolfSSL Leaving SSL_get_error, return -326
wolfSSL Entering SSL_get_error
wolfSSL Leaving SSL_get_error, return -326
wolfSSL Entering ERR_error_string
wolfSSL_connect error -326, record layer version error
wolfSSL Entering SSL_free
CTX ref count not 0 yet, no free
wolfSSL Leaving SSL_free, return 0
wolfSSL Entering SSL_CTX_free
CTX ref count down to 0, doing full free
wolfSSL Entering wolfSSL_CertManagerFree
wolfSSL Leaving SSL_CTX_free, return 0
wolfSSL error: wolfSSL_connect failed</code></pre></div><p>At the same time curl works fine:<br /></p><div class="codebox"><pre><code>$curl https://reqres.in/api/user/1</code></pre></div><p>Thanks in advance.</p>]]></description>
			<author><![CDATA[null@example.com (Pilatuz)]]></author>
			<pubDate>Thu, 14 Jun 2018 18:56:30 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post4005.html#p4005</guid>
		</item>
	</channel>
</rss>
