<?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 — wolfSSL_connect fail with -308, error state on socket]]></title>
		<link>https://www.wolfssl.com/forums/topic1204-wolfsslconnect-fail-with-308-error-state-on-socket.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1204.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in wolfSSL_connect fail with -308, error state on socket.]]></description>
		<lastBuildDate>Thu, 26 Apr 2018 22:36:54 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: wolfSSL_connect fail with -308, error state on socket]]></title>
			<link>https://www.wolfssl.com/forums/post3939.html#p3939</link>
			<description><![CDATA[<p>rmartin92 and Frank42,</p><p>A -313, Alert Fatal Error means the peer you are connecting to did not like something about the Client Hello message it received.</p><p>This is most commonly cause by an inability to match a common cipher suite or due to a missing extension that the peer wanted to see in the Client Hello message.</p><p>Can you tell me which cipher suites were configured and which peer you were trying to connect to? Is the peer publicly accessible so I can test it from my side?</p><p>You can dump the configured cipher suites in wolfSSL with:</p><div class="codebox"><pre><code>     char ciphers[4096]; //or some value you think is large enough.                                                         
                                                                                  
     int ret = wolfSSL_get_ciphers(ciphers, (int)sizeof(ciphers));                
                                                                                  
     if (ret == WOLFSSL_SUCCESS)                                                  
         printf(&quot;%s\n&quot;, ciphers); </code></pre></div><p>Warm Regards,</p><p>- K</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Thu, 26 Apr 2018 22:36:54 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post3939.html#p3939</guid>
		</item>
		<item>
			<title><![CDATA[Re: wolfSSL_connect fail with -308, error state on socket]]></title>
			<link>https://www.wolfssl.com/forums/post3937.html#p3937</link>
			<description><![CDATA[<p>Did you find the cause of your 313 error?</p>]]></description>
			<author><![CDATA[null@example.com (Frank42)]]></author>
			<pubDate>Thu, 26 Apr 2018 12:29:04 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post3937.html#p3937</guid>
		</item>
		<item>
			<title><![CDATA[Re: wolfSSL_connect fail with -308, error state on socket]]></title>
			<link>https://www.wolfssl.com/forums/post3907.html#p3907</link>
			<description><![CDATA[<p>Thanks.<br />We found the reason for the socket error.&nbsp; Due to memory constraints,&nbsp; we setup the the minimum required to for TLS.&nbsp; The reason for the socket error was not a socket error itself but that the callbacks for send and receive were not setup.&nbsp; &nbsp;One of our options ( I believe it was NOFILESYSTEM) caused the the xio callback to not be setup. After using the callback setup we were able to get past that option.&nbsp; &nbsp;Now wolfssl is establishing a connection with an error of -313.&nbsp; Here is the log <br />04/13/18-15:55:19:788 IP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug&nbsp; &nbsp; TSK: ETHPPP&nbsp; wolfSSL: received record layer msg<br />04/13/18-15:55:19:789 IP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug&nbsp; &nbsp; TSK: ETHPPP&nbsp; wolfSSL: got ALERT!<br />04/13/18-15:55:19:811 IP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug&nbsp; &nbsp; TSK: ETHPPP&nbsp; wolfSSL: Got alert<br />04/13/18-15:55:19:811 IP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug&nbsp; &nbsp; TSK: ETHPPP&nbsp; wolfSSL: wolfSSL error occurred, error = 40<br />04/13/18-15:55:19:815 IP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug&nbsp; &nbsp; TSK: ETHPPP&nbsp; wolfSSL: wolfSSL error occurred, error = -313<br />04/13/18-15:55:19:824 IP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug&nbsp; &nbsp; TSK: ETHPPP&nbsp; wolfSSL: wolfSSL Entering SSL_connect()</p><p>Not sure what this is...</p>]]></description>
			<author><![CDATA[null@example.com (rmartin92)]]></author>
			<pubDate>Fri, 13 Apr 2018 16:06:58 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post3907.html#p3907</guid>
		</item>
		<item>
			<title><![CDATA[Re: wolfSSL_connect fail with -308, error state on socket]]></title>
			<link>https://www.wolfssl.com/forums/post3905.html#p3905</link>
			<description><![CDATA[<p>There is not attached file.</p><p>308 is a general socket failure error.&nbsp; I say general because there are many things that can cause the socket to close.<br />If you sniff the Enet traffic you will get a better understanding of why the socket is closing.</p>]]></description>
			<author><![CDATA[null@example.com (Frank42)]]></author>
			<pubDate>Fri, 13 Apr 2018 12:05:01 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post3905.html#p3905</guid>
		</item>
		<item>
			<title><![CDATA[wolfSSL_connect fail with -308, error state on socket]]></title>
			<link>https://www.wolfssl.com/forums/post3900.html#p3900</link>
			<description><![CDATA[<p>We are using an embedded client in the KEIL MDK environment.&nbsp; Using the KEIL version of BSD for the interfaces.<br />Library was built with these settings.<br />#define HAVE_KEIL_RTX&nbsp; /* or define RTOS option */<br />#define WOLFSSL_USER_IO&nbsp; /* Use own TCP/IP lib */<br />#define NO_DEV_RANDOM<br />#define WOLFSSL_KEIL_TCP_NET<br />#define WOLFSSL_MDK_ARM<br />#define WOLFSSL_CALLBACKS<br />#define NO_WOLFSSL_DIR<br />#define NO_WRITEV<br />#define USE_FAST_MATH<br />#define TFM_TIMING_RESISTANT<br />#define NO_FILESYSTEM<br />#define NO_ECHOSERVER<br />#define NO_ECHOCLIENT<br />#define NO_SIMPLE_SERVER<br />#define NO_SIMPLE_CLIENT<br />#define NO_WOLFSSL_SERVER<br />#define SMALL_SESSION_CACHE<br />#undef USE_CERT_BUFFERS_1024<br />#undef WOLFSSL_SMALL_STACK</p><p>We do the standard socket create, bind, and connect for the socket using a google.com address and port 443.&nbsp; &nbsp;After we verify the connect we execute the&nbsp; wolfssl functions,<br />wolfSSL_CTX_new(wolfSSLv23_client_method())<br />wolfSSL_CTX_set_verify(pCtx, WOLFSSL_VERIFY_NONE, 0);<br />wolfSSL_new(pCtx))<br />wolfSSL_use_PrivateKey_buffer<br />wolfSSL_set_fd(pSSL, socket) <br />wolfSSL_connect(pSSL)</p><p>All function calls are successful except the wolfSSL_connect.<br />Quickly after issuing the wolfSSL _connect we get a -308 error.&nbsp; We wait for about 10 seconds before reporting the error in hopes that something will be sent to the server. The KEIL TCP debug is enable and we see that the wolfssl library never sends a handshake to the server.&nbsp; After the socket timeout period the server issues a close on the socket.<br />We have doubled checked the socket connection and it is definitely connected.<br />Can someone point us in a direction to determine what the issue is?<br />Attached is a KEIL TCP LOG.</p><p>Thanks</p>]]></description>
			<author><![CDATA[null@example.com (rmartin92)]]></author>
			<pubDate>Thu, 12 Apr 2018 21:13:58 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post3900.html#p3900</guid>
		</item>
	</channel>
</rss>
