<?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 — Unable to connect to smtp.gmail.com 465]]></title>
		<link>https://www.wolfssl.com/forums/topic1976-unable-to-connect-to-smtpgmailcom-465.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1976.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Unable to connect to smtp.gmail.com 465.]]></description>
		<lastBuildDate>Wed, 15 Mar 2023 19:07:40 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Unable to connect to smtp.gmail.com 465]]></title>
			<link>https://www.wolfssl.com/forums/post7019.html#p7019</link>
			<description><![CDATA[<p>I am answering your questions via the support ticket you opened in our ZenDesk portal</p>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Wed, 15 Mar 2023 19:07:40 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7019.html#p7019</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to connect to smtp.gmail.com 465]]></title>
			<link>https://www.wolfssl.com/forums/post7015.html#p7015</link>
			<description><![CDATA[<p>Many thanks so, where I have to put this switch? In which file?</p>]]></description>
			<author><![CDATA[null@example.com (mrdebug)]]></author>
			<pubDate>Wed, 15 Mar 2023 15:44:23 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7015.html#p7015</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to connect to smtp.gmail.com 465]]></title>
			<link>https://www.wolfssl.com/forums/post7014.html#p7014</link>
			<description><![CDATA[<p>You can use the configuration define </p><div class="codebox"><pre><code>WOLFSSL_ALT_CERT_CHAINS</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Wed, 15 Mar 2023 14:50:42 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7014.html#p7014</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to connect to smtp.gmail.com 465]]></title>
			<link>https://www.wolfssl.com/forums/post7013.html#p7013</link>
			<description><![CDATA[<p>Perfect, and which is the way to enable<br /><strong>--enable-altcertchains</strong><br />in wolfssl for esp32?</p>]]></description>
			<author><![CDATA[null@example.com (mrdebug)]]></author>
			<pubDate>Wed, 15 Mar 2023 14:46:46 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7013.html#p7013</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to connect to smtp.gmail.com 465]]></title>
			<link>https://www.wolfssl.com/forums/post7008.html#p7008</link>
			<description><![CDATA[<p>Hi mrdebug,</p><p>Thanks for joining the wolfSSL Forums. Try enabling alternate cert chains with </p><div class="codebox"><pre><code>--enable-altcertchains</code></pre></div><p> </p><div class="codebox"><pre><code>./examples/client/client -h www.google.com -p 443 -g -v 3 -A google.crt 
SSL version is TLSv1.2
SSL cipher suite is TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
SSL curve name is SECP256R1
Alternate cert chain used
SSL connect ok, sending GET...
HTTP/1.0 200 OK
Date: Wed, 15 Mar 2023 13:34:58 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
P3P: CP=&quot;This is not a P3P policy! See g.co/p3phelp for more info.&quot;
Server: gws
X-XSS-Protection: 0
X-Fra</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Wed, 15 Mar 2023 13:36:25 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7008.html#p7008</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to connect to smtp.gmail.com 465]]></title>
			<link>https://www.wolfssl.com/forums/post7006.html#p7006</link>
			<description><![CDATA[<p>I have the same problem with client example provided with wolfssl sources.<br />I have downloaded tge google certificate with thos command line:</p><div class="codebox"><pre><code>openssl s_client -showcerts -connect www.google.com:443 &lt;/dev/null | sed -n -e &#039;/-.BEGIN/,/-.END/ p&#039; &gt; google.crt</code></pre></div><p>and if I execute the client with this command line</p><div class="codebox"><pre><code>./examples/client/client -h www.google.com -p 443 -g -A google.crt -v 3</code></pre></div><p>I obtain the error</p><p><strong>wolfSSL_connect error -188, ASN no signer error to confirm failure<br />wolfSSL error: wolfSSL_connect failed</strong></p>]]></description>
			<author><![CDATA[null@example.com (mrdebug)]]></author>
			<pubDate>Wed, 15 Mar 2023 11:43:58 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7006.html#p7006</guid>
		</item>
		<item>
			<title><![CDATA[Unable to connect to smtp.gmail.com 465]]></title>
			<link>https://www.wolfssl.com/forums/post7004.html#p7004</link>
			<description><![CDATA[<p>Hi, I need to learn how to use wolfssl so, I have write a client to connect to a local server with a self signed certificate and it works.<br />Now I want to connect to a real server so I&#039;m trying to connect to smtp.gmail.com but my client does not work. I obtain the error</p><div class="codebox"><pre><code>wolfSSL_connect() Error!!!
Error: -188, ASN no signer error to confirm failure</code></pre></div><p>I have downloaded the certificate with this command line:<br /></p><div class="codebox"><pre><code>openssl s_client -showcerts -connect smtp.gmail.com:465 &lt;/dev/null | sed -n -e &#039;/-.BEGIN/,/-.END/ p&#039; &gt; gmail.crt</code></pre></div><p>and this is my client. To start it please type:<br /><strong>./Test02 smtp.gmail.com 465 gmail.crt</strong><br />Can anyone help me?<br />Best regards.</p><div class="codebox"><pre><code>#include &lt;QCoreApplication&gt;
#include &quot;QDebug&quot;
#include &lt;wolfssl/options.h&gt;
#include &lt;wolfssl/ssl.h&gt;

int main(int argc, char *argv[]) {
    QString RemoteServer;
    QString Certificate;
    int RemoteSocket= 0;
    if (argc&gt; 2) {
        RemoteServer= argv[1];
        RemoteSocket= QString(argv[2]).toInt();
        Certificate= argv[3];
        qDebug() &lt;&lt; RemoteServer &lt;&lt; RemoteSocket &lt;&lt; Certificate;
    }
    wolfSSL_Debugging_ON();
    int Result= wolfSSL_Init();
    if (Result!= WOLFSSL_SUCCESS) printf(&quot;wolfSSL_Init() Error!!!\n&quot;);
    else {
        WOLFSSL_CTX *Context= wolfSSL_CTX_new(wolfTLS_client_method());
        if (!Context) printf(&quot;wolfSSL_CTX_new() Error!!!\n&quot;);
        else {

            //Result = wolfSSL_CTX_UseSNI(Context, WOLFSSL_SNI_HOST_NAME, Certificate.toStdString().c_str(), Certificate.toStdString().size());


            Result= wolfSSL_CTX_use_certificate_file(Context, Certificate.toStdString().c_str(), SSL_FILETYPE_PEM);
            if (Result!= WOLFSSL_SUCCESS) printf(&quot;wolfSSL_CTX_use_certificate_file() Error!!!\n&quot;);
            else {
                if (Result!= WOLFSSL_SUCCESS) printf(&quot;wolfSSL_CTX_set_cipher_list() Error!!!\n&quot;);
                else {
                    Result= wolfSSL_CTX_load_verify_locations(Context, Certificate.toStdString().c_str(), nullptr);
                    if (Result!= WOLFSSL_SUCCESS) printf(&quot;wolfSSL_CTX_load_verify_locations() Error!!!\n&quot;);
                    else {
                        struct hostent *he= gethostbyname(RemoteServer.toStdString().c_str());
                        if (!he) printf(&quot;gethostbyname() Error!!!\n&quot;);
                        else {
                            struct in_addr **addr_list= (struct in_addr**)he-&gt;h_addr_list;
                            if (!addr_list[0]) printf(&quot;addr_list Error!!!\n&quot;);
                            else {
                                struct sockaddr_in AddrCloud;
                                AddrCloud.sin_addr.s_addr= *(long*)(he-&gt;h_addr);
                                AddrCloud.sin_family= AF_INET;
                                AddrCloud.sin_port= htons(RemoteSocket);
                                int Socket= socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
                                if (Socket&lt; 0) printf(&quot;SocketClient Error!!!\n&quot;);
                                else {


                                    //wolfSSL_CTX_set_verify(Context, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, nullptr);


                                    WOLFSSL *ssl= wolfSSL_new(Context);
                                    if (!ssl) printf(&quot;wolfSSL_new() Error!!!\n&quot;);
                                    else {
                                        Result= wolfSSL_set_fd(ssl, Socket);
                                        if (Result!= WOLFSSL_SUCCESS) printf(&quot;wolfSSL_set_fd() Error!!!\n&quot;);
                                        else {
                                            Result= connect(Socket, (struct sockaddr*)&amp;AddrCloud, sizeof(AddrCloud));
                                            if (Result!= 0) printf(&quot;connect() Error!!!\n&quot;);
                                            else {
                                                printf(&quot;CLIENT_CONNECTION_OPEN, try to bring up ssl client layer...\n&quot;);
                                                Result= wolfSSL_connect(ssl);
                                                if (Result!= WOLFSSL_SUCCESS) {
                                                    printf(&quot;wolfSSL_connect() Error!!!\n&quot;);
                                                    Result= wolfSSL_get_error(ssl, Result);
                                                    char Buffer[128];
                                                    wolfSSL_ERR_error_string(Result, Buffer);
                                                    printf(&quot;Error: %d, %s\n&quot;, Result, Buffer);
                                                } else {
                                                    printf(&quot;CLIENT_CONNECTION_OPEN, ssl client layer ok\n&quot;);
                                                    printf(&quot;SSL_get_version() %s\n&quot;, wolfSSL_get_version(ssl));
                                                    printf(&quot;SSL_get_cipher() %s\n&quot;, wolfSSL_get_cipher(ssl));
                                                    if (wolfSSL_get_peer_certificate(ssl)) {
                                                        Result= wolfSSL_get_verify_result(ssl);
                                                        if (Result== X509_V_OK) printf(&quot;Certiticate Verification Succeeded\n&quot;);
                                                        else if (Result== X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) printf(&quot;Certiticate X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT Error!!!\n&quot;);
                                                        else if (Result== X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN) printf(&quot;X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN Error!!!\n&quot;);
                                                        else {
                                                            printf(&quot;Certiticate Verification Failed %d\n&quot;, Result);
                                                        }
                                                    }
                                                    char Buffer[]= &quot;Hello world!!!\n&quot;;
                                                    Result= wolfSSL_write(ssl, Buffer, sizeof(Buffer));
                                                    if (Result!= sizeof(Buffer)) printf(&quot;wolfSSL_write() Error!!!\n&quot;);
                                                    else {
                                                        Result= wolfSSL_pending(ssl);
                                                        if (Result&gt; 0) {
                                                            memset(Buffer, &#039;0&#039;, sizeof(Buffer));
                                                            Result= wolfSSL_read(ssl, Buffer, sizeof(Buffer));
                                                            printf(&quot;%d, %s\n&quot;, Result, Buffer);
                                                        }
                                                    }
                                                    printf(&quot;ee1\n&quot;);
                                                    wolfSSL_shutdown(ssl);
                                                    printf(&quot;ee2\n&quot;);
                                                }
                                            }
                                        }
                                        wolfSSL_free(ssl);
                                    }
                                    shutdown(Socket, 0);
                                    close(Socket);
                                }
                            }
                        }
                    }
                }
            }
            wolfSSL_CTX_free(Context);
        }
        wolfSSL_Cleanup();
    }
    return 0;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (mrdebug)]]></author>
			<pubDate>Wed, 15 Mar 2023 09:32:59 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7004.html#p7004</guid>
		</item>
	</channel>
</rss>
