{"id":1249,"date":"2023-12-19T19:55:29","date_gmt":"2023-12-19T17:55:29","guid":{"rendered":"http:\/\/dety.net.ua\/?p=1249"},"modified":"2023-12-19T19:55:29","modified_gmt":"2023-12-19T17:55:29","slug":"exchange-2019-receive-connector-certificate-issue","status":"publish","type":"post","link":"https:\/\/dety.net.ua\/?p=1249","title":{"rendered":"Exchange 2019 + Receive Connector Certificate Issue"},"content":{"rendered":"\n<p>We\u2019ve got an error from the client about WordPress mail sending failure.<\/p>\n\n\n\n<p class=\"has-small-font-size\">Debug:<\/p>\n\n\n\n<p class=\"has-small-font-size\">Email Source: WP Mail SMTP<\/p>\n\n\n\n<p class=\"has-small-font-size\">Mailer: Other SMTP<\/p>\n\n\n\n<p class=\"has-small-font-size\">SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:<\/p>\n\n\n\n<p class=\"has-small-font-size\">error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failedSMTP server error: QUIT command failed<\/p>\n\n\n\n<p class=\"has-small-font-size\">2023-12-18 17:20:35 CLIENT -&gt; SERVER: STARTTLS<\/p>\n\n\n\n<p class=\"has-small-font-size\">2023-12-18 17:20:35 SERVER -&gt; CLIENT: 220 2.0.0 SMTP server ready<\/p>\n\n\n\n<p class=\"has-small-font-size\">2023-12-18 17:20:35 Connection failed. Error #2: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed [\/var\/www\/html\/wp-includes\/PHPMailer\/SMTP.php line 476]<\/p>\n\n\n\n<p class=\"has-small-font-size\">SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed<\/p>\n\n\n\n<p class=\"has-small-font-size\">2023-12-18 17:20:35 CLIENT -&gt; SERVER: QUIT<\/p>\n\n\n\n<p class=\"has-small-font-size\">SMTP OpenSSL check:<\/p>\n\n\n\n<p class=\"has-small-font-size\"><strong>openssl s_client -connect mail.server.com:587 -starttls smtp<\/strong><\/p>\n\n\n\n<p class=\"has-small-font-size\">CONNECTED(00000003)<\/p>\n\n\n\n<p class=\"has-small-font-size\">depth=0 CN =.com<\/p>\n\n\n\n<p class=\"has-small-font-size\">verify error:num=20:unable to get local issuer certificate<\/p>\n\n\n\n<p class=\"has-small-font-size\">verify return:1<\/p>\n\n\n\n<p class=\"has-small-font-size\">depth=0 CN =.com<\/p>\n\n\n\n<p class=\"has-small-font-size\">verify error:num=21:unable to verify the first certificate<\/p>\n\n\n\n<p class=\"has-small-font-size\">verify return:1<\/p>\n\n\n\n<p class=\"has-small-font-size\">depth=0 CN =.com<\/p>\n\n\n\n<p class=\"has-small-font-size\">verify return:1<\/p>\n\n\n\n<p class=\"has-small-font-size\">&#8212;<\/p>\n\n\n\n<p class=\"has-small-font-size\">Certificate chain<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;0 s:CN =.com<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp; a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp; v:NotBefore: Dec 14 18:43:46 2023 GMT; NotAfter: Dec 13 18:43:46 2024 GMT<\/p>\n\n\n\n<p class=\"has-small-font-size\">&#8212;<\/p>\n\n\n\n<p class=\"has-small-font-size\">Server certificate<\/p>\n\n\n\n<p class=\"has-small-font-size\">&#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;<\/p>\n\n\n\n<p class=\"has-small-font-size\">&#8212;&#8211;END CERTIFICATE&#8212;&#8211;<\/p>\n\n\n\n<p class=\"has-small-font-size\">subject=CN =.com<\/p>\n\n\n\n<p class=\"has-small-font-size\">issuer=DC = com,<\/p>\n\n\n\n<p class=\"has-small-font-size\">&#8212;<\/p>\n\n\n\n<p class=\"has-small-font-size\">No client certificate CA names sent<\/p>\n\n\n\n<p class=\"has-small-font-size\">Peer signing digest: SHA256<\/p>\n\n\n\n<p class=\"has-small-font-size\">Peer signature type: RSA<\/p>\n\n\n\n<p class=\"has-small-font-size\">Server Temp Key: ECDH, secp384r1, 384 bits<\/p>\n\n\n\n<p class=\"has-small-font-size\">&#8212;<\/p>\n\n\n\n<p class=\"has-small-font-size\">SSL handshake has read 2679 bytes and written 513 bytes<\/p>\n\n\n\n<p class=\"has-small-font-size\"><strong>Verification error: unable to verify the first certificate<\/strong><\/p>\n\n\n\n<p class=\"has-small-font-size\">&#8212;<\/p>\n\n\n\n<p class=\"has-small-font-size\">New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384<\/p>\n\n\n\n<p class=\"has-small-font-size\">Server public key is 2048 bit<\/p>\n\n\n\n<p class=\"has-small-font-size\">Secure Renegotiation IS supported<\/p>\n\n\n\n<p class=\"has-small-font-size\">Compression: NONE<\/p>\n\n\n\n<p class=\"has-small-font-size\">Expansion: NONE<\/p>\n\n\n\n<p class=\"has-small-font-size\">No ALPN negotiated<\/p>\n\n\n\n<p class=\"has-small-font-size\">SSL-Session:<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; Protocol&nbsp; : TLSv1.2<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; Cipher&nbsp;&nbsp;&nbsp; : ECDHE-RSA-AES256-GCM-SHA384<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; Session-ID: 964A0000F62300131AB8EC758DB53C2BDB0EBBBC6CC6AFC58A0D7CFBF4A80680<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; Session-ID-ctx:<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; Master-Key:<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; PSK identity: None<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; PSK identity hint: None<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; SRP username: None<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; Start Time: 1703004291<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; Timeout&nbsp;&nbsp; : 7200 (sec)<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; Verify return code: 21 (unable to verify the first certificate)<\/p>\n\n\n\n<p class=\"has-small-font-size\">&nbsp;&nbsp;&nbsp; Extended master secret: yes<\/p>\n\n\n\n<p class=\"has-small-font-size\">&#8212;<\/p>\n\n\n\n<p class=\"has-small-font-size\">250 SMTPUTF8<\/p>\n\n\n\n<p>We checked the Exchange Server:<\/p>\n\n\n\n<p>[PS] C:\\&gt;<strong>Get-ExchangeCertificate<\/strong><\/p>\n\n\n\n<p class=\"has-small-font-size\">Thumbprint&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Services&nbsp;&nbsp; Subject<\/p>\n\n\n\n<p class=\"has-small-font-size\">&#8212;&#8212;&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8211;&nbsp;&nbsp; &#8212;&#8212;-<\/p>\n\n\n\n<p class=\"has-small-font-size\">D58156A24F5F75F1A5EA288B3FE92CA1B5C33859&nbsp; &#8230;&#8230;.&nbsp;&nbsp;&nbsp; CN=.com<\/p>\n\n\n\n<p class=\"has-small-font-size\">A2A66C232FBB1AD846386FDBAC38EBC225844E89&nbsp; &#8230;.S..&nbsp;&nbsp;&nbsp; CN= V28<\/p>\n\n\n\n<p class=\"has-small-font-size\">745634734DF2974C9441092DBE1DF7E9F2DDDBE7&nbsp; &#8230;&#8230;.&nbsp;&nbsp;&nbsp; CN=CLIUSR<\/p>\n\n\n\n<p class=\"has-small-font-size\">9803DE33A89F90B06E2629A7BC52C51969A66017&nbsp; IP.WS..&nbsp;&nbsp;&nbsp; CN=.com<\/p>\n\n\n\n<p class=\"has-small-font-size\">2DC2C1DAA06E234ABF57D3E8792FA93320C532DD&nbsp; &#8230;&#8230;.&nbsp;&nbsp;&nbsp; CN=CLIUSR<\/p>\n\n\n\n<p class=\"has-small-font-size\">1511938F82535F158ED22F3040E2D900BED6A49D&nbsp; &#8230;&#8230;.&nbsp;&nbsp;&nbsp; CN=CLIUSR<\/p>\n\n\n\n<p class=\"has-small-font-size\">027B83E66330CCACF1560F805C0C79AEA93CFC1E&nbsp; &#8230;&#8230;.&nbsp;&nbsp;&nbsp; CN=CLIUSR<\/p>\n\n\n\n<p class=\"has-small-font-size\">8C928F1ED907DF896A3DD4216F47C45B2EF3ECE2&nbsp; &#8230;.S..&nbsp;&nbsp;&nbsp; CN=Microsoft Exchange Server Auth Certificate<\/p>\n\n\n\n<p class=\"has-small-font-size\">9A13D41F2C19D04B1930A79F383E0B948982774B&nbsp; &#8230;.S..&nbsp;&nbsp;&nbsp; CN= V28<\/p>\n\n\n\n<p class=\"has-small-font-size\">27A2966214A07F6F4C946D650A87F1751596ACCA&nbsp; &#8230;&#8230;.&nbsp;&nbsp;&nbsp; CN=WMSvc-SHA2-EX22<\/p>\n\n\n\n<p><strong>get-receiveconnector &#8221; V28\\Client Proxy V28&#8243; | fl<\/strong><\/p>\n\n\n\n<p>We saw that there is the certificate from our internal CA for this server. So, the server automatically enrolled the certificate and <strong>replaced somehow the certificate for Receive Connector at port 587<\/strong>.<\/p>\n\n\n\n<p>We replaced the certificate as in an example:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-practical-365 wp-block-embed-practical-365\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"Hc6ZwL2Gat\"><a href=\"https:\/\/practical365.com\/configuring-the-tls-certificate-name-for-exchange-server-receive-connectors\/\">Configuring the TLS Certificate Name for Exchange Server Receive Connectors<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Configuring the TLS Certificate Name for Exchange Server Receive Connectors&#8221; &#8212; Practical 365\" src=\"https:\/\/practical365.com\/configuring-the-tls-certificate-name-for-exchange-server-receive-connectors\/embed\/#?secret=Yo1t1dgnPS#?secret=Hc6ZwL2Gat\" data-secret=\"Hc6ZwL2Gat\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>We found the certificate thumbprint and apply Set-ReceiveConnector for this Connector.<\/p>\n\n\n\n<p><strong>Get-ExchangeCertificate<\/strong><\/p>\n\n\n\n<p><strong>$cert = Get-ExchangeCertificate -Thumbprint DE67EC3C8D679AA35D17678FEC51907272B1BAE2<\/strong><\/p>\n\n\n\n<p><strong>$tlscertificatename = &#8220;&lt;i&gt;$($cert.Issuer)&lt;s&gt;$($cert.Subject)&#8221;<\/strong><\/p>\n\n\n\n<p><strong>Set-ReceiveConnector &#8220;EX2016SRV1\\Client Frontend EX2016SRV1&#8221; -TlsCertificateName $tlscertificatename<\/strong><\/p>\n\n\n\n<p>The issue was fixed.<\/p>\n\n\n\n<p>Openssl showed:<\/p>\n\n\n\n<p class=\"has-small-font-size\">subject=CN =.com<\/p>\n\n\n\n<p class=\"has-small-font-size\">issuer=C = US, ST = Arizona, L = Scottsdale, O = &#8220;GoDaddy.com, Inc.&#8221;, OU = http:\/\/certs.godaddy.com\/repository\/, CN = Go Daddy Secure Certificate Authority &#8211; G2<\/p>\n\n\n\n<p class=\"has-small-font-size\">&#8212;<\/p>\n\n\n\n<p class=\"has-small-font-size\">No client certificate CA names sent<\/p>\n\n\n\n<p class=\"has-small-font-size\">Peer signing digest: SHA256<\/p>\n\n\n\n<p class=\"has-small-font-size\">Peer signature type: RSA<\/p>\n\n\n\n<p class=\"has-small-font-size\">Server Temp Key: ECDH, secp384r1, 384 bits<\/p>\n\n\n\n<p class=\"has-small-font-size\">&#8212;<\/p>\n\n\n\n<p class=\"has-small-font-size\">SSL handshake has read 5066 bytes and written 513 bytes<\/p>\n\n\n\n<p class=\"has-small-font-size\"><strong>Verification: OK<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019ve got an error from the client about WordPress mail sending failure. Debug: Email Source: WP Mail SMTP Mailer: Other SMTP SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failedSMTP server error: QUIT command failed 2023-12-18 17:20:35 CLIENT -&gt; SERVER: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1249","post","type-post","status-publish","format-standard","hentry","category-exchange"],"_links":{"self":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/1249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1249"}],"version-history":[{"count":1,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/1249\/revisions"}],"predecessor-version":[{"id":1250,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/1249\/revisions\/1250"}],"wp:attachment":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}