{"id":4294,"date":"2024-12-08T12:48:55","date_gmt":"2024-12-08T12:48:55","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=4294"},"modified":"2024-12-08T13:31:34","modified_gmt":"2024-12-08T13:31:34","slug":"exchange-2016-smtp-starttls-didnt-find-starttls-in-server-response","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=4294","title":{"rendered":"Exchange 2016 SMTP StartTLS &#8220;Didn&#8217;t find STARTTLS in server response&#8221;"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">We use SMTP on our Exchange Servers to provide authenticated SMTP email service for those who are using email clients which require SMTP to send email. We had an issue that following a certificate expiry that any SMTP connections to the server (that were attempting to use STARTTLS) would fail. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ openssl s_client -starttls smtp exchange1.domain.com:587\nCONNECTED(00000003)\nDidn't find STARTTLS in server response, trying anyway...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The issue was that the old certificates had become invalid, however they were still in use by the SMTP server. We&#8217;d already added the new certificate on there ready, we just needed to swap it. You can do this as follows, firstly get the list of certificates installed on the server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>get-exchangecertificate -server exchange1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The run this to check which is installed on the Exchange server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>get-receiveconnector \"EXCHANGE1\\Client Frontend EXCHANGE1\" | select *<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">From the first command you&#8217;ll see a list of Thumbprints, you&#8217;ll want to identify which of these you want to use, i.e. your new certificate, once you have found the correct thumbprint:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$cert = Get-ExchangeCertificate -Thumbprint &lt;as per the output>\n$tlscertificatename = \"&lt;i>$($cert.Issuer)&lt;s>$($cert.Subject)\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally you can set the certificate on the receive connector using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Set-ReceiveConnector \"EXCHANGE1\\Client Frontend EXCHANGE1\" -TlsCertificateName $tlscertificatename<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once that is done, repeat the test using OpenSSL and you should find the server is responding as expected, you shouldn&#8217;t need to restart any services (e.g. Microsoft Exchange Transport Service) for the new certificate to have taken effect.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We use SMTP on our Exchange Servers to provide authenticated SMTP email service for those who are using email clients which require SMTP to send email. We had an issue that following a certificate expiry that any SMTP connections to the server (that were attempting to use STARTTLS) would fail. For example: The issue was &#8230; <a title=\"Exchange 2016 SMTP StartTLS &#8220;Didn&#8217;t find STARTTLS in server response&#8221;\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=4294\" aria-label=\"Read more about Exchange 2016 SMTP StartTLS &#8220;Didn&#8217;t find STARTTLS in server response&#8221;\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":4299,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,14],"tags":[],"class_list":["post-4294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-exchange","category-microsoft-windows"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4294"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4294\/revisions"}],"predecessor-version":[{"id":4295,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4294\/revisions\/4295"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/media\/4299"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}