<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Expert Opinion (Posts about certificate)</title><link>http://findlay.space/</link><description></description><atom:link href="http://findlay.space/categories/certificate.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2020 &lt;a href="mailto:justin@findlay.space"&gt;jmoney&lt;/a&gt; 
&lt;a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/"&gt;
&lt;img alt="Creative Commons License BY-NC-SA"
style="border-width:0; margin-bottom:12px;"
src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png"&gt;&lt;/a&gt;</copyright><lastBuildDate>Fri, 11 Sep 2020 20:35:47 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>HowTo Get a Site's Certificate Fingerprint</title><link>http://findlay.space/posts/howto-get-a-sites-certificate-fingerprint/</link><dc:creator>jmoney</dc:creator><description>&lt;div&gt;&lt;p&gt;I finally got around to setting up TLS to the IRC servers that I use.  It is
incredible that this is not default or that there does not even seem to be
conventional ports.  &lt;a class="reference external" href="https://freenode.net/kb/answer/chat"&gt;Freenode&lt;/a&gt;
&lt;a class="reference external" href="https://freenode.net/news/port-6697-irc-via-tlsssl"&gt;suggests&lt;/a&gt; &lt;code class="docutils literal"&gt;6697&lt;/code&gt;,
&lt;code class="docutils literal"&gt;7000&lt;/code&gt;, and &lt;code class="docutils literal"&gt;7070&lt;/code&gt;, but there is an &lt;a class="reference external" href="https://tools.ietf.org/html/draft-hartmann-default-port-for-irc-via-tls-ssl-09"&gt;independent draft standard&lt;/a&gt;
for &lt;code class="docutils literal"&gt;6697&lt;/code&gt;.&lt;/p&gt;
&lt;!-- TEASER_END --&gt;
&lt;p&gt;&lt;a class="reference external" href="irc://irc.xmission.com/"&gt;Another server&lt;/a&gt; I connect to is protected by a
wildcard domain certificate, but WeeChat did not want to verify the
certificate:&lt;/p&gt;
&lt;pre class="code irc"&gt;&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-1"&gt;&lt;/a&gt;09:09:28 xmission  -- | irc: reconnecting to server...
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-2"&gt;&lt;/a&gt;09:09:28 xmission  -- | irc: connecting to server irc.xmission.com/6697 (SSL)...
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-3"&gt;&lt;/a&gt;09:09:28 xmission  -- | gnutls: connected using 2048-bit Diffie-Hellman shared secret exchange
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-4"&gt;&lt;/a&gt;09:09:28 xmission  -- | gnutls: receiving 1 certificate
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-5"&gt;&lt;/a&gt;09:09:28 xmission  -- |  - certificate[1] info:
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-6"&gt;&lt;/a&gt;09:09:28 xmission  -- |    - subject `CN=*.xmission.com,O=XMission Networks
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-7"&gt;&lt;/a&gt;09:09:28 xmission  -- |      LLC,L=Salt Lake City,ST=Utah,C=US', issuer
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-8"&gt;&lt;/a&gt;09:09:28 xmission  -- |      `CN=DigiCert SHA2 Secure Server CA,O=DigiCert
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-9"&gt;&lt;/a&gt;09:09:28 xmission  -- |      Inc,C=US', serial
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-10"&gt;&lt;/a&gt;09:09:28 xmission  -- |      0x081a17d0d17cfe5abd82f38b2396070e, RSA key
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-11"&gt;&lt;/a&gt;09:09:28 xmission  -- |      2048 bits, signed using RSA-SHA256, activated
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-12"&gt;&lt;/a&gt;09:09:28 xmission  -- |      `2016-02-09 00:00:00 UTC', expires `2019-04-12
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-13"&gt;&lt;/a&gt;09:09:28 xmission  -- |      12:00:00 UTC', key-ID
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-14"&gt;&lt;/a&gt;09:09:28 xmission  -- |      `sha256:a9fbe66d6490806d4c827c9a22f63c3985ffc689af85c737d060458f605b121d'
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-15"&gt;&lt;/a&gt;09:09:28 xmission =!= | gnutls: peer's certificate is NOT trusted
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-16"&gt;&lt;/a&gt;09:09:28 xmission =!= | gnutls: peer's certificate issuer is unknown
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-17"&gt;&lt;/a&gt;09:09:28 xmission =!= | irc: TLS handshake failed
&lt;a name="rest_code_a8b0bb68a3f94c7b9fc1e95a4a0fe5f1-18"&gt;&lt;/a&gt;09:09:28 xmission =!= | irc: error: Error in the certificate.
&lt;/pre&gt;&lt;p&gt;I'm not particularly interested in why the CA certificate bundle that ships
with openssl or certifi (mozilla) (both of which I tried) do not automagically
enable all the encryptions for this domain since I was able to find an easy
workaround for my use case.  The workaround involves &lt;a class="reference external" href="https://serverfault.com/questions/139728/192731"&gt;downloading the
certificate&lt;/a&gt; and &lt;a class="reference external" href="https://unix.stackexchange.com/questions/140601/140606"&gt;extracting
the fingerprint&lt;/a&gt;.&lt;/p&gt;
&lt;pre class="code bash"&gt;&lt;a name="rest_code_2ea4d9d2010844938a9bfd8658e020aa-1"&gt;&lt;/a&gt;$ &lt;span class="nv"&gt;SERVER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;irc.xmission.com
&lt;a name="rest_code_2ea4d9d2010844938a9bfd8658e020aa-2"&gt;&lt;/a&gt;$ &lt;span class="nv"&gt;PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;6697&lt;/span&gt;
&lt;a name="rest_code_2ea4d9d2010844938a9bfd8658e020aa-3"&gt;&lt;/a&gt;$ &lt;span class="nb"&gt;echo&lt;/span&gt; -n &lt;span class="p"&gt;|&lt;/span&gt; openssl s_client -connect &lt;span class="nv"&gt;$SERVER&lt;/span&gt;:&lt;span class="nv"&gt;$PORT&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&amp;gt;/dev/null &lt;span class="p"&gt;|&lt;/span&gt; sed -ne &lt;span class="s1"&gt;'/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; openssl x509 -noout -fingerprint -sha256
&lt;a name="rest_code_2ea4d9d2010844938a9bfd8658e020aa-4"&gt;&lt;/a&gt;SHA256 &lt;span class="nv"&gt;Fingerprint&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;D9:47:5E:E4:69:24:09:7D:57:B9:5A:A1:2F:B6:3D:94:C5:19:A2:85:46:47:F8:02:3B:24:DF:0A:87:08:33:C9
&lt;/pre&gt;&lt;p&gt;WeeChat needs the fingerprint without the delimiters (&lt;code class="docutils literal"&gt;:&lt;/code&gt;) at the byte
boundaries, so (I'm sure the multiple sed and openssl commands could be
factored but that's ostensibly too much effort for the present need):&lt;/p&gt;
&lt;pre class="code bash"&gt;&lt;a name="rest_code_739b2e16110e40f7b97871e4e8ca7d8d-1"&gt;&lt;/a&gt;$ &lt;span class="nb"&gt;echo&lt;/span&gt; -n &lt;span class="p"&gt;|&lt;/span&gt; openssl s_client -connect &lt;span class="nv"&gt;$SERVER&lt;/span&gt;:&lt;span class="nv"&gt;$PORT&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&amp;gt;/dev/null &lt;span class="p"&gt;|&lt;/span&gt; sed -ne &lt;span class="s1"&gt;'/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; openssl x509 -noout -fingerprint -sha256 &lt;span class="p"&gt;|&lt;/span&gt; sed &lt;span class="s1"&gt;'s/SHA256 Fingerprint=//'&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; sed &lt;span class="s1"&gt;'s/://g'&lt;/span&gt;
&lt;a name="rest_code_739b2e16110e40f7b97871e4e8ca7d8d-2"&gt;&lt;/a&gt;D9475EE46924097D57B95AA12FB63D94C519A2854647F8023B24DF0A870833C9
&lt;/pre&gt;&lt;p&gt;Now, if you randomly happen to have the exact same problem that triggered this
descent of inquiry as I, execute the following commands in WeeChat:&lt;/p&gt;
&lt;pre class="code irc"&gt;&lt;a name="rest_code_abd46acd85154036a63583df82218826-1"&gt;&lt;/a&gt;/set irc.server.xmission.address irc.xmission.com/6697
&lt;a name="rest_code_abd46acd85154036a63583df82218826-2"&gt;&lt;/a&gt;/set irc.server.xmission.ssl on
&lt;a name="rest_code_abd46acd85154036a63583df82218826-3"&gt;&lt;/a&gt;/set irc.server.xmission.ssl_fingerprint D9475EE46924097D57B95AA12FB63D94C519A2854647F8023B24DF0A870833C9
&lt;a name="rest_code_abd46acd85154036a63583df82218826-4"&gt;&lt;/a&gt;/save
&lt;a name="rest_code_abd46acd85154036a63583df82218826-5"&gt;&lt;/a&gt;...
&lt;a name="rest_code_abd46acd85154036a63583df82218826-6"&gt;&lt;/a&gt;/reconnect xmission
&lt;a name="rest_code_abd46acd85154036a63583df82218826-7"&gt;&lt;/a&gt;...
&lt;a name="rest_code_abd46acd85154036a63583df82218826-8"&gt;&lt;/a&gt;13:02:10 xmission  -- | irc: disconnected from server
&lt;a name="rest_code_abd46acd85154036a63583df82218826-9"&gt;&lt;/a&gt;13:02:10 xmission  -- | irc: connecting to server irc.xmission.com/6697 (SSL)...
&lt;a name="rest_code_abd46acd85154036a63583df82218826-10"&gt;&lt;/a&gt;13:02:10 xmission  -- | gnutls: connected using 2048-bit Diffie-Hellman shared secret exchange
&lt;a name="rest_code_abd46acd85154036a63583df82218826-11"&gt;&lt;/a&gt;13:02:10 xmission  -- | gnutls: receiving 1 certificate
&lt;a name="rest_code_abd46acd85154036a63583df82218826-12"&gt;&lt;/a&gt;13:02:10 xmission  -- |  - certificate[1] info:
&lt;a name="rest_code_abd46acd85154036a63583df82218826-13"&gt;&lt;/a&gt;13:02:10 xmission  -- |    - subject `CN=*.xmission.com,O=XMission Networks
&lt;a name="rest_code_abd46acd85154036a63583df82218826-14"&gt;&lt;/a&gt;13:02:10 xmission  -- |      LLC,L=Salt Lake City,ST=Utah,C=US', issuer
&lt;a name="rest_code_abd46acd85154036a63583df82218826-15"&gt;&lt;/a&gt;13:02:10 xmission  -- |      `CN=DigiCert SHA2 Secure Server CA,O=DigiCert
&lt;a name="rest_code_abd46acd85154036a63583df82218826-16"&gt;&lt;/a&gt;13:02:10 xmission  -- |      Inc,C=US', serial
&lt;a name="rest_code_abd46acd85154036a63583df82218826-17"&gt;&lt;/a&gt;13:02:10 xmission  -- |      0x081a17d0d17cfe5abd82f38b2396070e, RSA key
&lt;a name="rest_code_abd46acd85154036a63583df82218826-18"&gt;&lt;/a&gt;13:02:10 xmission  -- |      2048 bits, signed using RSA-SHA256, activated
&lt;a name="rest_code_abd46acd85154036a63583df82218826-19"&gt;&lt;/a&gt;13:02:10 xmission  -- |      `2016-02-09 00:00:00 UTC', expires `2019-04-12
&lt;a name="rest_code_abd46acd85154036a63583df82218826-20"&gt;&lt;/a&gt;13:02:10 xmission  -- |      12:00:00 UTC', key-ID
&lt;a name="rest_code_abd46acd85154036a63583df82218826-21"&gt;&lt;/a&gt;13:02:10 xmission  -- |      `sha256:a9fbe66d6490806d4c827c9a22f63c3985ffc689af85c737d060458f605b121d'
&lt;a name="rest_code_abd46acd85154036a63583df82218826-22"&gt;&lt;/a&gt;13:02:10 xmission  -- | gnutls: certificate fingerprint matches
&lt;a name="rest_code_abd46acd85154036a63583df82218826-23"&gt;&lt;/a&gt;13:02:10 xmission  -- | irc: connected to irc.xmission.com/6697 (198.60.22.35)
&lt;/pre&gt;&lt;p&gt;You will have to verify whether your IRC server &lt;a class="reference external" href="https://tools.ietf.org/html/draft-hartmann-default-port-for-irc-via-tls-ssl-09"&gt;respects&lt;/a&gt;
port &lt;code class="docutils literal"&gt;6697&lt;/code&gt; as the TLS port.&lt;/p&gt;&lt;/div&gt;</description><category>certificate</category><category>fingerprint</category><category>openssl</category><category>sha</category><category>tls</category><category>weechat</category><guid>http://findlay.space/posts/howto-get-a-sites-certificate-fingerprint/</guid><pubDate>Mon, 12 Feb 2018 21:16:29 GMT</pubDate></item></channel></rss>