<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SSL | The End of the Tunnel</title><link>https://development--vigilant-hodgkin-644b1e.netlify.com/tags/ssl/</link><atom:link href="https://development--vigilant-hodgkin-644b1e.netlify.com/tags/ssl/index.xml" rel="self" type="application/rss+xml"/><description>SSL</description><generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><copyright>© 2019 Derek Murawsky</copyright><lastBuildDate>Wed, 17 Sep 2014 16:27:17 -0400</lastBuildDate><image><url>https://development--vigilant-hodgkin-644b1e.netlify.com/img/icon-32.png</url><title>SSL</title><link>https://development--vigilant-hodgkin-644b1e.netlify.com/tags/ssl/</link></image><item><title>A Hundred Domains and SHA-1 Depreciation</title><link>https://development--vigilant-hodgkin-644b1e.netlify.com/post/hundred-domains-sha1-deprication/</link><pubDate>Wed, 17 Sep 2014 16:27:17 -0400</pubDate><guid>https://development--vigilant-hodgkin-644b1e.netlify.com/post/hundred-domains-sha1-deprication/</guid><description>&lt;p&gt;Apparently I’ve been living under a rock for a while, because I didn’t know that SHA-1 was being phased out in the immediate future. Thank you, GoDaddy, for notifying me with a month and change to spare. As it turns out, Google will no longer be trusting certain SHA-1 signed SSL certificates with the release of Chrome 39, which is set for November. For details, see the following links.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://blog.chromium.org/2014/09/gradually-sunsetting-sha-1.html&#34; target=&#34;_blank&#34;&gt;Gradually Sunsetting SHA-1&lt;/a&gt; (Google)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://blogs.technet.com/b/pki/archive/2013/11/12/sha1-deprecation-policy.aspx&#34; target=&#34;_blank&#34;&gt;SHA1 Deprecation Policy&lt;/a&gt; (Microsoft)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://blog.mozilla.org/security/2014/09/08/phasing-out-certificates-with-1024-bit-rsa-keys/&#34; target=&#34;_blank&#34;&gt;Phasing out Certificates with 1024-bit RSA Keys&lt;/a&gt; (Mozilla)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Due to the fact that our clients often purchase their own SSL certificates, we have no internal records to check what algorithm was used to sign the certificates in use. So now we get to audit slightly over 100 domains to check and see what signature algorithm is in use. We could browse to each domain manually and take a look at their certificate but that would just take way too long. There were some web based tools around that could do it, but they also only worked on one site at a time.&lt;/p&gt;
&lt;p&gt;So, instead, I looked to PowerShell to see what could be done… Unfortunately, there was no native cmdlet to do anything like this! I did find a module that had a lot of great PKI-related functionality, the &lt;a href=&#34;https://pspki.codeplex.com/wikipage?title=Test-WebServerSSL&#34; target=&#34;_blank&#34;&gt;Public Key Infrastructure PowerShell&lt;/a&gt; module, but it, too, didn’t have the much-needed signature algorithm. However, it did provide a very robust base on which to build. Below is the solution I came up with.&lt;/p&gt;
&lt;p&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-Powershell&#34; data-lang=&#34;Powershell&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; get-SSLSigningAlgorithm {
[&lt;span style=&#34;color:#66d9ef&#34;&gt;CmdletBinding&lt;/span&gt;()]
&lt;span style=&#34;color:#66d9ef&#34;&gt;param&lt;/span&gt;(
[&lt;span style=&#34;color:#66d9ef&#34;&gt;Parameter&lt;/span&gt;(&lt;span style=&#34;color:#66d9ef&#34;&gt;Mandatory&lt;/span&gt; = $true, &lt;span style=&#34;color:#66d9ef&#34;&gt;ValueFromPipeline&lt;/span&gt; = $true, &lt;span style=&#34;color:#66d9ef&#34;&gt;Position&lt;/span&gt; = 0)]
&lt;span style=&#34;color:#66d9ef&#34;&gt;[string]&lt;/span&gt;$URL,
[&lt;span style=&#34;color:#66d9ef&#34;&gt;Parameter&lt;/span&gt;(&lt;span style=&#34;color:#66d9ef&#34;&gt;Position&lt;/span&gt; = 1)]
[&lt;span style=&#34;color:#66d9ef&#34;&gt;ValidateRange&lt;/span&gt;(1,65535)]
&lt;span style=&#34;color:#66d9ef&#34;&gt;[int]&lt;/span&gt;$Port = 443,
[&lt;span style=&#34;color:#66d9ef&#34;&gt;Parameter&lt;/span&gt;(&lt;span style=&#34;color:#66d9ef&#34;&gt;Position&lt;/span&gt; = 2)]
&lt;span style=&#34;color:#66d9ef&#34;&gt;[Net.WebProxy]&lt;/span&gt;$Proxy,
[&lt;span style=&#34;color:#66d9ef&#34;&gt;Parameter&lt;/span&gt;(&lt;span style=&#34;color:#66d9ef&#34;&gt;Position&lt;/span&gt; = 3)]
&lt;span style=&#34;color:#66d9ef&#34;&gt;[int]&lt;/span&gt;$Timeout = 15000,
&lt;span style=&#34;color:#66d9ef&#34;&gt;[switch]&lt;/span&gt;$UseUserContext
)
$ConnectString = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://$url`:$port&amp;#34;&lt;/span&gt;
$WebRequest = &lt;span style=&#34;color:#66d9ef&#34;&gt;[Net.WebRequest]&lt;/span&gt;::Create($ConnectString)
$WebRequest.Proxy = $Proxy
$WebRequest.Credentials = $null
$WebRequest.Timeout = $Timeout
$WebRequest.AllowAutoRedirect = $true
&lt;span style=&#34;color:#66d9ef&#34;&gt;[Net.ServicePointManager]&lt;/span&gt;::ServerCertificateValidationCallback = {$true}
&lt;span style=&#34;color:#66d9ef&#34;&gt;try&lt;/span&gt; {$Response = $WebRequest.GetResponse()}
&lt;span style=&#34;color:#66d9ef&#34;&gt;catch&lt;/span&gt; {}
&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; ($WebRequest.ServicePoint.Certificate &lt;span style=&#34;color:#f92672&#34;&gt;-ne&lt;/span&gt; $null) {
$Cert = &lt;span style=&#34;color:#66d9ef&#34;&gt;[Security.Cryptography.X509Certificates.X509Certificate2]&lt;/span&gt;$WebRequest.ServicePoint.Certificate.Handle
write-host $Cert.SignatureAlgorithm.FriendlyName;
} &lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt; {
Write-Error $Error[0]
}
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
I’ll create a CSV of the domains that I need to check, and iterate over them in a for-each loop. That function will be used within the loop to check the sites, and the output will go into another CSV. We’ll use that to plan our re-keying.&lt;/p&gt;</description></item></channel></rss>