<div dir="ltr"><div dir="ltr">On Sat, 10 Aug 2019 at 11:46, Giles Orr <<a href="mailto:gilesorr@gmail.com" target="_blank">gilesorr@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">...<div><a href="https://www.gilesorr.com/blog/tls-https-details.html" target="_blank">https://www.gilesorr.com/blog/tls-https-details.html</a></div><div><br></div>Any suggestions to improve the script would be most welcome.<br></div>
</blockquote></div><div><br></div><div>Jason:</div><div><br></div><div>You are of course correct: '#!/usr/bin/env bash' is more portable.  I don't usually bother because '#!/usr/bin/bash' works fine on every Linux I've used and on Mac, so I don't think to fix this when I make my scripts public ...<br></div><div><br></div><div>Dave:</div><div>"Line 130 s/-eq/=/"</div><div><br></div><div>See, that's interesting ...  First, "==" would be correct for a Bash string comparison, not "=" (which is correct for 'sh').  Second ...  Arguably it's a numeric comparison (thus '-eq'), but I did put quotes around it which probably makes it string ...  <sigh>  Yeah, I don't know what that should be.  It's worked so far ...<br></div><div><br></div><div>Stewart:</div><div>"It's just a little loud on sites that don't support https:"</div><div><br></div><div>My apologies: I did think of that and test for it ... but on precisely one site where it returned silently and all was good.  I tested on a site that responds on port 80, but doesn't respond at all on port 443.  The site you named sends a 400 "Bugger off" response (technically "Bad Request") on port 443.  Probably because you have a hosting provider who reasonably enough listens on that port whether the site has a certificate or not.  I naively assumed that a site without a cert wouldn't be listening on port 443.  I'll think about that.<br></div><div><br></div><div>William:</div><div>'How does it compare with "testssl.sh" ?'</div><div><br></div><div>I have no idea, I haven't used that.  If you point me to it I'll take a look.<br></div><div><br></div>-- <br><div dir="ltr" class="m_-1238351153442367488gmail_signature">Giles<br><a href="https://www.gilesorr.com/" target="_blank">https://www.gilesorr.com/</a><br><a href="mailto:gilesorr@gmail.com" target="_blank">gilesorr@gmail.com</a></div></div>