<?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 — Familiarity with the library]]></title>
		<link>https://www.wolfssl.com/forums/topic703-familiarity-with-the-library.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic703.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Familiarity with the library.]]></description>
		<lastBuildDate>Tue, 01 Sep 2015 22:34:38 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Familiarity with the library]]></title>
			<link>https://www.wolfssl.com/forums/post2174.html#p2174</link>
			<description><![CDATA[<p>Hi Alexander79,</p><p>I had not heard back from you in a day or two. I was just checking in to see if you were able to get those example projects working. Let me know if there is anything else.</p><p>Kind Regards,</p><p>Kaleb</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Tue, 01 Sep 2015 22:34:38 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2174.html#p2174</guid>
		</item>
		<item>
			<title><![CDATA[Re: Familiarity with the library]]></title>
			<link>https://www.wolfssl.com/forums/post2171.html#p2171</link>
			<description><![CDATA[<p>Hi Alexander79,</p><div class="quotebox"><blockquote><p>But function wolfSSL_CTX_use_certificate_file() return error while trying parse file server-ecc.pem from WolfSSL library.<br />I looked inside this function, it&#039;s open and read file, but there is some error while parsing.</p></blockquote></div><p>There are two potential reasons that function would return an error if you use the certificate in our libraries. Either the certificate is not in the correct location or it is expired. Check the dates on the certificate you&#039;re using and make sure today&#039;s date falls inbetween the ASN before and after date. For example today is Aug 31 2015 so a cert with the following dates is not expired. (Also ensure your computer has the correct date set as our libraries will use your systems date to check expiration on a certificate).</p><div class="codebox"><pre><code>            Not Before: May  7 18:21:01 2015 GMT
            Not After : Jan 31 18:21:01 2018 GMT</code></pre></div><p>Secondly you may have the certificate in a different location then I did. Make sure the path is correct.<br />This line in the file may need to have a different path then </p><div class="codebox"><pre><code>../certs/server-ecc.pem</code></pre></div><p> depending on where<br />your project is being built.</p><div class="codebox"><pre><code>if (wolfSSL_CTX_use_certificate_file(ctx, &quot;../certs/server-ecc.pem&quot;,</code></pre></div><p>I updated the example this morning <a href="https://github.com/wolfSSL/wolfssl-examples/blob/master/tls/server-tls-ecdhe.c">https://github.com/wolfSSL/wolfssl-exam … ls-ecdhe.c</a> to allow for debugging also. If you add </p><div class="codebox"><pre><code>DEBUG_WOLFSSL</code></pre></div><p> to your pre-processor definitions you should get more meaningful error codes back. Error codes can be viewed in the following locations:</p><p>If your project returns an error between -100 and -300 see wolfssl/wolfssl/wolfcrypt/error-crypt.h<br />If project returns an error between -301 and -501 see wolfssl/wolfssl/error-ssl.h</p><p>Regards,</p><p>Kaleb</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Mon, 31 Aug 2015 16:21:22 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2171.html#p2171</guid>
		</item>
		<item>
			<title><![CDATA[Re: Familiarity with the library]]></title>
			<link>https://www.wolfssl.com/forums/post2169.html#p2169</link>
			<description><![CDATA[<p>I&#039; use as example this source code:<br /><a href="https://github.com/wolfSSL/wolfssl-examples/blob/master/tls/server-tls-ecdhe.c">https://github.com/wolfSSL/wolfssl-exam … ls-ecdhe.c</a></p><p>But function wolfSSL_CTX_use_certificate_file() return error while trying parse file <strong>server-ecc.pem</strong> from WolfSSL library.<br />I looked inside this function, it&#039;s open and read file, but there is some error while parsing.</p>]]></description>
			<author><![CDATA[null@example.com (Alexander79)]]></author>
			<pubDate>Sat, 29 Aug 2015 22:40:39 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2169.html#p2169</guid>
		</item>
		<item>
			<title><![CDATA[Re: Familiarity with the library]]></title>
			<link>https://www.wolfssl.com/forums/post2168.html#p2168</link>
			<description><![CDATA[<p>Hi alexander79,</p><p>I can not fix your code unfortunately. I have never worked in or with C++ or C# unfortunately and cannot get your code to compile in a reasonable amount of time. What I will do is post two examples of an example client and server in our examples directory on github. You can view the code there and try to translate that into your working language/environment.</p><p>Link to client: <a href="https://github.com/wolfSSL/wolfssl-examples/blob/master/tls/client-tls-ecdhe.c">https://github.com/wolfSSL/wolfssl-exam … ls-ecdhe.c</a></p><p>Link to server: <a href="https://github.com/wolfSSL/wolfssl-examples/blob/master/tls/server-tls-ecdhe.c">https://github.com/wolfSSL/wolfssl-exam … ls-ecdhe.c</a></p><p>I am also including a diff of the base client with the ecdh additions so you can see what changes were made:</p><p>Client diff:<br /></p><div class="codebox"><pre><code>--- client-tls.c    2015-08-28 14:02:17.000000000 -0600
+++ client-tls-ecdhe.c    2015-08-28 13:44:15.000000000 -0600
@@ -23,12 +23,14 @@
 #include    &lt;string.h&gt;
 #include    &lt;errno.h&gt;
 #include    &lt;arpa/inet.h&gt;
+#include    &lt;wolfssl/options.h&gt;
 #include    &lt;wolfssl/ssl.h&gt;          /* wolfSSL security library */
+#include    &lt;wolfssl/test.h&gt;
 
 #define MAXDATASIZE  4096           /* maximum acceptable amount of data */
 #define SERV_PORT    11111          /* define default port number */
 
-const char* cert = &quot;../certs/ca-cert.pem&quot;;
+const char* cert = &quot;../certs/server-ecc.pem&quot;;
 
 /*
  * clients initial contact with server. (socket to connect, security layer)
@@ -68,6 +70,10 @@
     WOLFSSL_CTX* ctx;
     WOLFSSL*     ssl;    /* create WOLFSSL object */
     int         ret = 0;
+    const char* myCert        = &quot;../certs/client-ecc-cert.pem&quot;;
+    const char* myKey         = &quot;../certs/ecc-client-key.pem&quot;;
+    char* cipherList          = &quot;ECDHE-ECDSA-CHACHA20-POLY1305&quot;;
+    char buffer[WOLFSSL_MAX_ERROR_SZ];
 
     wolfSSL_Init();      /* initialize wolfSSL */
 
@@ -77,11 +83,25 @@
         return EXIT_FAILURE;
     }
 
+    if (wolfSSL_CTX_set_cipher_list(ctx, cipherList) != SSL_SUCCESS)
+            err_sys(&quot;client can&#039;t set cipher list 1&quot;);
+
+    if (wolfSSL_CTX_use_certificate_chain_file(ctx, myCert)
+                                                               != SSL_SUCCESS)
+            err_sys(&quot;can&#039;t load client cert file, check file and run from&quot;
+                    &quot; wolfSSL home dir&quot;);
+
+    if (wolfSSL_CTX_use_PrivateKey_file(ctx, myKey, SSL_FILETYPE_PEM)
+                                         != SSL_SUCCESS)
+            err_sys(&quot;can&#039;t load client private key file, check file and run &quot;
+                    &quot;from wolfSSL home dir&quot;);
+
     /* load CA certificates into wolfSSL_CTX. which will verify the server */
     if (wolfSSL_CTX_load_verify_locations(ctx, cert, 0) != SSL_SUCCESS) {
         printf(&quot;Error loading %s. Please check the file.\n&quot;, cert);
         return EXIT_FAILURE;
     }
+
     if ((ssl = wolfSSL_new(ctx)) == NULL) {
         printf(&quot;wolfSSL_new error.\n&quot;);
         return EXIT_FAILURE;
@@ -91,8 +111,14 @@
     ret = wolfSSL_connect(ssl);
     if (ret == SSL_SUCCESS) {
         ret = ClientGreet(sock, ssl);
+    } else {
+        printf(&quot;Failure:&quot;);
+        ret = wolfSSL_get_error(ssl, 0);
+        printf(&quot; ret = %d&quot;, ret);
+        printf(&quot; %s\n&quot;, wolfSSL_ERR_error_string(ret, buffer));
     }
 
+
     /* frees all data before client termination */
     wolfSSL_free(ssl);
     wolfSSL_CTX_free(ctx);</code></pre></div><p>Server diff:<br /></p><div class="codebox"><pre><code>--- server-tls.c    2015-08-28 14:05:27.000000000 -0600
+++ server-tls-ecdhe.c    2015-08-28 14:06:19.000000000 -0600
@@ -32,6 +32,7 @@
 #include &lt;netinet/in.h&gt;
 #include &lt;stdlib.h&gt;
 #include &lt;errno.h&gt;
+#include &lt;wolfssl/options.h&gt;
 
 /* include the wolfSSL library for our TLS 1.2 security */
 #include &lt;wolfssl/ssl.h&gt;
@@ -124,6 +125,7 @@
     int ret      = 0; /* Return value */
     /* Server and client socket address structures */
     struct sockaddr_in serverAddr, clientAddr;
+    char* cipherList = &quot;ECDHE-ECDSA-CHACHA20-POLY1305&quot;;
 
     /* Initialize wolfSSL */
     wolfSSL_Init();
@@ -141,7 +143,7 @@
     }
 
     /* Load server certificate into WOLFSSL_CTX */
-    if (wolfSSL_CTX_use_certificate_file(ctx, &quot;../certs/server-cert.pem&quot;,
+    if (wolfSSL_CTX_use_certificate_file(ctx, &quot;../certs/server-ecc.pem&quot;,
                 SSL_FILETYPE_PEM) != SSL_SUCCESS) {
         fprintf(stderr, &quot;Error loading certs/server-cert.pem, please check&quot;
                 &quot;the file.\n&quot;);
@@ -149,13 +151,16 @@
     }
 
     /* Load server key into WOLFSSL_CTX */
-    if (wolfSSL_CTX_use_PrivateKey_file(ctx, &quot;../certs/server-key.pem&quot;,
+    if (wolfSSL_CTX_use_PrivateKey_file(ctx, &quot;../certs/ecc-key.pem&quot;,
                 SSL_FILETYPE_PEM) != SSL_SUCCESS) {
         fprintf(stderr, &quot;Error loading certs/server-key.pem, please check&quot;
                 &quot;the file.\n&quot;);
         return EXIT_FAILURE;
     }
 
+    if (wolfSSL_CTX_set_cipher_list(ctx, cipherList) != SSL_SUCCESS)
+            printf(&quot;client can&#039;t set cipher list 1&quot;);
+
     /* Initialize the server address struct to zero */
     memset((char *)&amp;serverAddr, 0, sizeof(serverAddr));
 </code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Fri, 28 Aug 2015 20:08:55 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2168.html#p2168</guid>
		</item>
		<item>
			<title><![CDATA[Re: Familiarity with the library]]></title>
			<link>https://www.wolfssl.com/forums/post2166.html#p2166</link>
			<description><![CDATA[<p>Don&#039;t understand, what I&#039;m doing wrong...<br />Please, look at my source code, I post it down here.<br />On server side, function wolfSSL_accept return error, after function wolfSSL_connect at client side.</p><p>Also don&#039;t understand how to work with cipher&#039;s and certificate&#039;s, with functions wolfSSL_CTX_set_cipher_list and wolfSSL_CTX_SetTmpDH.</p><p>I was readed manuals, looked samples, but still cannot make it work...</p><p>Can you fix my source code, please?<br />Tell me, please, what I&#039;m doing wrong?</p><p>There is simple echo client-server:<br />SERVER<br /></p><div class="codebox"><pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;algorithm&gt;
#include &lt;conio.h&gt;
#include &lt;wolfssl/ssl.h&gt;

#define CERT_SERVER_PATH &quot;Certs/server-cert.pem&quot;
#define KEY_SERVER_PATH &quot;Certs/server-key.pem&quot;
#define PORT 1234

#define Assert(expr) _ASSERT_EXPR((expr), _CRT_WIDE(#expr))

#define _WINSOCKAPI_
#include &lt;Windows.h&gt;

#include &lt;winsock2.h&gt;
#pragma comment(lib, &quot;ws2_32.lib&quot;)

void Exit(WOLFSSL* ssl)
{
    std::string err_str(80, 0);

    int err = wolfSSL_get_error(ssl, 0);
    wolfSSL_ERR_error_string(err, &amp;err_str[0]);

    std::cerr &lt;&lt; err_str &lt;&lt; &quot;\n&quot;;
    Assert(false &amp;&amp; &quot;Error&quot;);
    exit(-1);
}

WOLFSSL_CTX* Init()
{
    WSADATA wsa_data;
    WORD version;

    version = MAKEWORD(2, 0);
    WSAStartup(version, &amp;wsa_data);

    wolfSSL_Init();

    auto ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method());

    const char* cipher_list = &quot;DHE-RSA-AES128-SHA256&quot;;
    if (wolfSSL_CTX_set_cipher_list(ctx, cipher_list) != SSL_SUCCESS)
        Exit(nullptr);

    return ctx;
}

void LoadCerts(WOLFSSL_CTX* ctx)
{
    if (wolfSSL_CTX_use_certificate_file(ctx, CERT_SERVER_PATH, SSL_FILETYPE_PEM) != SSL_SUCCESS)
        Exit(nullptr);

    if (wolfSSL_CTX_use_PrivateKey_file(ctx, KEY_SERVER_PATH, SSL_FILETYPE_PEM) != SSL_SUCCESS)
        Exit(nullptr);
}

int Send(WOLFSSL* ssl, const std::string&amp; data)
{
    return wolfSSL_write(ssl, (char*)data.c_str(), data.size());
}

int Recv(WOLFSSL* ssl, std::string&amp; data, int size)
{
    return wolfSSL_read(ssl, (char*)&amp;data[0], size);
}

void Clean(WOLFSSL* ssl, WOLFSSL_CTX* ctx)
{
    wolfSSL_shutdown(ssl);
    wolfSSL_free(ssl);
    wolfSSL_CTX_free(ctx);
    wolfSSL_Cleanup();
    WSACleanup();
}

int main()
{
    int yes = 1;
    SOCKET server_socket = INVALID_SOCKET;
    struct sockaddr_in sockaddr;

    WOLFSSL_CTX* ctx = nullptr;
    WOLFSSL* ssl = nullptr;

    if (!(ctx = Init()))
        Exit(nullptr);

    LoadCerts(ctx);

    server_socket = ::WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, 0, 0, 0);

    memset(&amp;sockaddr, 0x00, sizeof(sockaddr_in));
    sockaddr.sin_family = AF_INET;
    sockaddr.sin_port = htons(PORT);
    sockaddr.sin_addr.s_addr = htonl(INADDR_ANY);

    ::setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR, (const char*)&amp;yes, sizeof(int));
    ::bind(server_socket, (struct sockaddr*)&amp;sockaddr, sizeof(struct sockaddr));
    ::listen(server_socket, 1);

    std::cout &lt;&lt; &quot;Waiting connection...\n&quot;;
    SOCKET client_socket = ::accept(server_socket, nullptr, nullptr);
    std::cout &lt;&lt; &quot;Got new connection\n&quot;;

    if (!(ssl = wolfSSL_new(ctx)))
        Exit(ssl);

    wolfSSL_set_fd(ssl, client_socket);

    if (wolfSSL_accept(ssl) != SSL_SUCCESS)
        Exit(ssl);

    std::cout &lt;&lt; &quot;Secure socket ready\n&quot;;
    std::string data(80, 0);

    if (!Recv(ssl, data, data.size()))
        Exit(ssl);

    std::cout &lt;&lt; &quot;Recv: &quot; &lt;&lt; data &lt;&lt; &quot;\n&quot;;

    data.erase(std::remove(data.begin(), data.end(), &#039;\0&#039;), data.end());
    data += &quot;  &lt;---&gt; ECHO\n&quot;;

    if (!Send(ssl, data))
        Exit(ssl);

    Clean(ssl, ctx);
    std::cout &lt;&lt; &quot;\nDone\n&quot;;
    _getch();
    return 0;
}</code></pre></div><p>CLIENT<br /></p><div class="codebox"><pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;algorithm&gt;
#include &lt;conio.h&gt;
#include &lt;wolfssl/ssl.h&gt;

#define CERT_CLIENT_PATH &quot;Certs/client-cert.pem&quot;
#define IP &quot;127.0.0.1&quot;
#define PORT 1234

#define Assert(expr) _ASSERT_EXPR((expr), _CRT_WIDE(#expr))

#define _WINSOCKAPI_
#include &lt;Windows.h&gt;

#include &lt;winsock2.h&gt;
#pragma comment(lib, &quot;ws2_32.lib&quot;)

void Exit(WOLFSSL* ssl)
{
    std::string err_str(80, 0);

    int err = wolfSSL_get_error(ssl, 0);
    wolfSSL_ERR_error_string(err, &amp;err_str[0]);

    std::cerr &lt;&lt; err_str &lt;&lt; &quot;\n&quot;;
    Assert(false &amp;&amp; &quot;Error&quot;);
    exit(-1);
}

WOLFSSL_CTX* Init()
{
    WSADATA wsa_data;
    WORD version;

    version = MAKEWORD(2, 0);
    WSAStartup(version, &amp;wsa_data);

    wolfSSL_Init();

    auto ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());

    const char* cipher_list = &quot;DHE-RSA-AES128-SHA256&quot;;
    if (wolfSSL_CTX_set_cipher_list(ctx, cipher_list) != SSL_SUCCESS)
        Exit(nullptr);

    return ctx;
}

int Send(WOLFSSL* ssl, const std::string&amp; data)
{
    return wolfSSL_write(ssl, (char*)data.c_str(), data.size());
}

int Recv(WOLFSSL* ssl, std::string&amp; data, int size)
{
    return wolfSSL_read(ssl, (char*)&amp;data[0], size);
}

void Clean(WOLFSSL* ssl, WOLFSSL_CTX* ctx)
{
    wolfSSL_shutdown(ssl);
    wolfSSL_free(ssl);
    wolfSSL_CTX_free(ctx);
    wolfSSL_Cleanup();
    WSACleanup();
}

int main()
{
    int yes = 1;
    SOCKET socket = INVALID_SOCKET;
    struct sockaddr_in sockaddr;

    WOLFSSL_CTX* ctx = nullptr;
    WOLFSSL* ssl = nullptr;

    if (!(ctx = Init()))
        Exit(nullptr);

    struct hostent* target = nullptr;

    socket = ::WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, 0, 0, 0);
    target = gethostbyname(IP);

    memset(&amp;sockaddr, 0x00, sizeof(sockaddr_in));
    sockaddr.sin_family = AF_INET;
    ((u_long*)&amp;sockaddr.sin_addr)[0] = ((u_long**)target-&gt;h_addr_list)[0][0];
    sockaddr.sin_port = htons(PORT);

    std::cout &lt;&lt; &quot;Connecting... &quot;;
    if (::connect(socket, (struct sockaddr*)&amp;sockaddr, sizeof(sockaddr)) == SOCKET_ERROR)
        Exit(nullptr);

    if (!(ssl = wolfSSL_new(ctx)))
        Exit(ssl);

    wolfSSL_set_fd(ssl, socket);

    if (wolfSSL_connect(ssl) == SSL_SUCCESS)
        Exit(ssl);

    std::cout &lt;&lt; &quot; Done\n&quot;;
    std::string data = &quot;hello&quot;;

    if (!Send(ssl, data))
        Exit(ssl);

    if (!Recv(ssl, data, data.size()))
        Exit(ssl);

    std::cout &lt;&lt; &quot;Respone: &quot; &lt;&lt; data;

    Clean(ssl, ctx);
    std::cout &lt;&lt; &quot;\nDone\n&quot;;
    _getch();
    return 0;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alexander79)]]></author>
			<pubDate>Thu, 27 Aug 2015 20:30:33 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2166.html#p2166</guid>
		</item>
		<item>
			<title><![CDATA[Re: Familiarity with the library]]></title>
			<link>https://www.wolfssl.com/forums/post2165.html#p2165</link>
			<description><![CDATA[<p>Hi Alexander79,</p><p>1) use one of the following functions to set the DH parameters:<br /></p><div class="codebox"><pre><code>wolfSSL_SetTmpDH(ssl, p, sizeof(p), g, sizeof(g));</code></pre></div><p>or<br /></p><div class="codebox"><pre><code>wolfSSL_CTX_SetTmpDH(ctx, p, sizeof(p), g, sizeof(g));</code></pre></div><p>2) by setting the cipher list this tells the server what ciphers the client supports. The server will select the strongest option that it and the client both support for use of the session</p><p>Client can store certificate and keys in the same way we store them in the file wolfssl/certs_test.h if there is no file system</p><p>You can read more about these and more here:&nbsp; <a href="https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-10-wolfcrypt-usage-reference.html">https://www.wolfssl.com/wolfSSL/Docs-wo … rence.html</a></p><p>or in our API documentation here:<br /><a href="http://wolfssl.com/wolfSSL/Docs-wolfssl-manual-17-wolfssl-api-reference.html">http://wolfssl.com/wolfSSL/Docs-wolfssl … rence.html</a></p><p>Kind Regards,</p><p>Kaleb</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Tue, 25 Aug 2015 22:19:55 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2165.html#p2165</guid>
		</item>
		<item>
			<title><![CDATA[Re: Familiarity with the library]]></title>
			<link>https://www.wolfssl.com/forums/post2162.html#p2162</link>
			<description><![CDATA[<p>Thanks for your answer.<br />About question 2.<br />1) I add certificate (wolfSSL_CTX_use_certificate_file) and private key file (wolfSSL_CTX_use_PrivateKey_file). What should I do next to use DHE? <br />2) What can I do with wolfSSL_CTX_set_cipher_list next?</p><p>If certificate file and the key will located in one directory with server - this is normal.<br />Client should not store any files (certificate, keys etc).</p>]]></description>
			<author><![CDATA[null@example.com (Alexander79)]]></author>
			<pubDate>Tue, 25 Aug 2015 11:56:50 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2162.html#p2162</guid>
		</item>
		<item>
			<title><![CDATA[Re: Familiarity with the library]]></title>
			<link>https://www.wolfssl.com/forums/post2161.html#p2161</link>
			<description><![CDATA[<p>Hi Alexander79,</p><p>For question 1:<br />The server is going to connect to the socket and call wolfSSL_accept() where it will wait to read 5 bytes (ssl record header). If after reading the 5 byte record header the server determines whether the connection is not a TLS connection wolfSSL_accept() will return an error code which your application can then check. At that point your application can do whatever you desire with the socket. example:<br /></p><div class="codebox"><pre><code>if (wolfSSL_accept(ssl) != SSL_SUCCESS)                                     
      {                                                                           
          int err = wolfSSL_get_error(ssl, 0);                                    
          char buffer[WOLFSSL_MAX_ERROR_SZ];                                      
          printf(&quot;error = %d, %s\n&quot;, err, wolfSSL_ERR_error_string(err, buffer)); 
          /*err_sys(&quot;SSL_accept failed&quot;);*/                                                              
      }</code></pre></div><p>Question 2:<br />You will need to use DHE or ECDHE based cipher suite. You can set these by using wolfSSL_CTX_set_cipher_list() this function is defined in wolfssl/ssl.h. example: </p><div class="codebox"><pre><code>if (wolfSSL_CTX_set_cipher_list(cipherSuiteCtx, suite) == SSL_SUCCESS)
      valid = 1</code></pre></div><p>For negotiating the ephemeral key you will have to load a public and private key file however the ephemeral key will automatically be negotiated internally in our libraries.</p><p>Load public key:<br /></p><div class="codebox"><pre><code>         if (SSL_CTX_use_certificate_file(ctx, ourCert, SSL_FILETYPE_PEM)        
                                          != SSL_SUCCESS)
                         err_sys(&quot;can&#039;t load server cert file, check file and run from&quot;      
                     &quot; wolfSSL home dir&quot;);</code></pre></div><p>Load private key:<br /></p><div class="codebox"><pre><code>         if (SSL_CTX_use_PrivateKey_file(ctx, ourKey, SSL_FILETYPE_PEM)          
                                          != SSL_SUCCESS)                        
             err_sys(&quot;can&#039;t load server private key file, check file and run &quot;   
                 &quot;from wolfSSL home dir&quot;);</code></pre></div><p>Kind Regards,</p><p>Kaleb</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Mon, 24 Aug 2015 23:32:05 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2161.html#p2161</guid>
		</item>
		<item>
			<title><![CDATA[Re: Familiarity with the library]]></title>
			<link>https://www.wolfssl.com/forums/post2160.html#p2160</link>
			<description><![CDATA[<p>Hi Alexander79,</p><p>Thank you for your question. I am looking into it and will have an answer for you shortly.</p><p>Regards,</p><p>Kaleb</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Mon, 24 Aug 2015 22:53:28 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2160.html#p2160</guid>
		</item>
		<item>
			<title><![CDATA[Re: Familiarity with the library]]></title>
			<link>https://www.wolfssl.com/forums/post2158.html#p2158</link>
			<description><![CDATA[<p>Can anybody help me please?</p>]]></description>
			<author><![CDATA[null@example.com (Alexander79)]]></author>
			<pubDate>Mon, 24 Aug 2015 18:50:37 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2158.html#p2158</guid>
		</item>
		<item>
			<title><![CDATA[Familiarity with the library]]></title>
			<link>https://www.wolfssl.com/forums/post2155.html#p2155</link>
			<description><![CDATA[<p>Hello everyone!<br />Not long time ago I has met with the library WolfSSL.<br />This library has made a big impression on me.<br />Immediately apologize for my English, I use google translate.</p><p>For the study I was wrote two simple programs: an echo server and client to add their support TLS 1.2.</p><p>I have a few questions:<br />1) It is necessary to make sure that the server has only worked with TLS and did not support the work of insecure channel. If the client connecting without TLS support, it must be disconnected by server. How this can be done (on the server side)?</p><p>2) It is necessary to add support for TLS to disposable keys were generated and unique to each session, and not store it on file in file system. I read about the mechanism of formation of the key for the current session in SSL/TLS - Ephemeral Diffie-Hellman. How to use it in WolfSSL library?</p><p>If possible, please give examples.<br />Thank you for attention.</p>]]></description>
			<author><![CDATA[null@example.com (Alexander79)]]></author>
			<pubDate>Sun, 23 Aug 2015 14:19:32 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2155.html#p2155</guid>
		</item>
	</channel>
</rss>
