<?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 — STM32CubeMX_STM32F407_FreeRTOS_Lwip to wolfSSL5.5.3  err -308]]></title>
		<link>https://www.wolfssl.com/forums/topic1932-stm32cubemxstm32f407freertoslwip-to-wolfssl553-err-308.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1932.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in STM32CubeMX_STM32F407_FreeRTOS_Lwip to wolfSSL5.5.3  err -308.]]></description>
		<lastBuildDate>Tue, 22 Nov 2022 02:16:39 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: STM32CubeMX_STM32F407_FreeRTOS_Lwip to wolfSSL5.5.3  err -308]]></title>
			<link>https://www.wolfssl.com/forums/post6818.html#p6818</link>
			<description><![CDATA[<p>The problem has been solved. Thank you for your help.</p>]]></description>
			<author><![CDATA[null@example.com (linxiong2)]]></author>
			<pubDate>Tue, 22 Nov 2022 02:16:39 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6818.html#p6818</guid>
		</item>
		<item>
			<title><![CDATA[Re: STM32CubeMX_STM32F407_FreeRTOS_Lwip to wolfSSL5.5.3  err -308]]></title>
			<link>https://www.wolfssl.com/forums/post6817.html#p6817</link>
			<description><![CDATA[<p>Hello linxiong2</p><p>Thanks for joining the wolfSSL forums. The error is due to the IO callbacks being configured but not set:</p><div class="quotebox"><blockquote><p>Your IO Send callback is null, please set</p></blockquote></div><p>For LWIP we support their socket interface by default if you add `WOLFSSL_LWIP` to the generated configuration file `wolfSSL.I-CUBE-wolfSSL_conf.h`.</p><p>The documentation or the Cube pack is here:<br /><a href="https://github.com/wolfSSL/wolfssl/tree">https://github.com/wolfSSL/wolfssl/tree</a> … /STM32Cube</p><p>Thanks,<br />Eric - wolfSSL Support</p>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Mon, 21 Nov 2022 15:38:46 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6817.html#p6817</guid>
		</item>
		<item>
			<title><![CDATA[STM32CubeMX_STM32F407_FreeRTOS_Lwip to wolfSSL5.5.3  err -308]]></title>
			<link>https://www.wolfssl.com/forums/post6816.html#p6816</link>
			<description><![CDATA[<p>When trying to connect my client , I get the -308 error on both client processes.</p><p>I was wondering if there is anyway I can see what is causing it.</p><p>I&#039;ve been dealing with it for days. Still can&#039;t find the problem.</p><p>Thanks.</p><div class="codebox"><pre><code>wolfSSL Entering wolfSSL_Init
wolfSSL Entering wolfCrypt_Init
wolfSSL Entering SSLv23_client_method_ex
wolfSSL Entering wolfSSL_CTX_new_ex
wolfSSL Entering wolfSSL_CertManagerNew
wolfSSL Leaving WOLFSSL_CTX_new, return 0
wolfSSL Entering wolfSSL_CTX_set_verify
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 SendTls13ClientHello
Adding signature algorithms extension
Adding supported versions extension
wolfSSL Entering EccMakeKey
wolfSSL Leaving EccMakeKey, return 0
growing output buffer
Key Share extension to write
Supported Versions extension to write
Signature Algorithms extension to write
Point Formats extension to write
Supported Groups extension to write
Encrypt-Then-Mac extension to write
EMS extension to write
Your IO Send callback is null, please set
wolfSSL Leaving SendTls13ClientHello, return -308
wolfSSL error occurred, error = -308
wolfSSL Entering SSL_get_error
wolfSSL Leaving SSL_get_error, return -308
wolfSSL Entering ERR_error_string
error = -308, error state on socket
wolfSSL Entering SSL_shutdown()
wolfSSL Entering SendAlert
growing output buffer
Your IO Send callback is null, please set
wolfSSL Leaving SendAlert, return -308
wolfSSL error occurred, error = -308
wolfSSL Entering SSL_free
Free&#039;ing client ssl
Shrinking output buffer
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 Entering wolfSSL_Cleanup
wolfSSL Entering wolfCrypt_Cleanup</code></pre></div><br /><br /><div class="codebox"><pre><code>    int fd;
    int len;
    int ret;
    const int PORT = 443;
    struct sockaddr_in addr;
    memset(&amp;addr,0,sizeof(addr));

    WOLFSSL *ssl = NULL;
    WOLFSSL_CTX* ctx = NULL;
        wolfSSL_Debugging_ON();
    do
    { 
        wolfSSL_Init(); 
        if ((ctx = wolfSSL_CTX_new(wolfSSLv23_client_method())) == NULL) 
        {
            printf( &quot;wolfSSL_CTX_new error.\r\n&quot;);
            wolfSSL_CTX_free(ctx);
            return -1;
        } 
        wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);

        
        if ((ssl = wolfSSL_new(ctx)) == NULL)
        {
            printf(&quot;wolfssl new fail\r\n&quot;);
            break;
        } 
 
        if ((fd = socket(AF_INET, SOCK_STREAM, 0)) &lt; 0)
        {
            printf(&quot;fd &lt; 0\r\n&quot;);
            break;
        }

        addr.sin_addr.s_addr = inet_addr(ipAddr); //baidu ip
        addr.sin_family = AF_INET;
        addr.sin_port = htons(PORT);

        while(connect(fd,(struct sockaddr*)&amp;addr,sizeof(addr)) != 0)
        {
            printf(&quot;connect error \r\n&quot;);    
        } 
        if ((ret = wolfSSL_set_fd(ssl,fd)) != SSL_SUCCESS)
        {
            printf(&quot;set fd fail\r\n&quot;);
            break;
        }
        
        if ((ret = wolfSSL_connect(ssl)) != SSL_SUCCESS)
        {
            char buffer[80];
            int err = wolfSSL_get_error(ssl, ret);
            printf(&quot;error = %d, %s\r\n&quot;, err, wolfSSL_ERR_error_string(err, buffer));   
            break;
        }

        //wolfssl will connect before write/read
        len = wolfSSL_write(ssl,(byte*)request_get,strlen(request_get));
        if(len &lt; 0)
        {
            printf(&quot;ssl write fail\r\n&quot;);
            break;
        }
        printf(&quot;%s&quot;,request_get);
  
        char ch[1024];
        while(wolfSSL_read(ssl, &amp;ch, 1024) &gt; 0)
        { 
            printf(&quot;%s&quot;, ch);
            memset(ch, 0, 1024);
        }
       
    } while (0);

    close(fd); 
    wolfSSL_shutdown(ssl);
    wolfSSL_free(ssl);
    wolfSSL_CTX_free(ctx);
    wolfSSL_Cleanup();</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (linxiong2)]]></author>
			<pubDate>Mon, 21 Nov 2022 05:56:09 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6816.html#p6816</guid>
		</item>
	</channel>
</rss>
