How do I get Visual Studio Code to trust our self-signed proxy certificate?

This is a terrible answer (not very secure), but appears to be the current Microsoft official answer. Use “http.proxyStrictSSL”: false in your settings.json file. This should work to get around the issue of installing extensions inside a corporate network, but I’d recommend disabling the setting if you are going to be working from home/coffee shop … Read more

How to revoke an openssl certificate when you don’t have the certificate

(Based on Nilesh’s answer) In the default configuration, openssl will keep copies of all signed certificates in /etc/ssl/newcerts, named by its index number. So grep /etc/ssl/index.txt to obtain the serial number of the key to be revoked, e.g. 1013, then execute the following command: openssl ca -revoke /etc/ssl/newcerts/1013.pem #replacing the serial number The -keyfile and … Read more

Why is there a handshake failure when trying to run TLS over TLS with this code?

There are at least two problems with OnionProtocol: The innermost TLSMemoryBIOProtocol becomes the wrappedProtocol, when it should be the outermost; ProtocolWithoutConnectionLost does not pop any TLSMemoryBIOProtocols off OnionProtocol‘s stack, because connectionLost is only called after a FileDescriptors doRead or doWrite methods return a reason for disconnection. We can’t solve the first problem without changing the … Read more

How to Check Subject Alternative Names for a SSL/TLS Certificate?

To get the Subject Alternative Names (SAN) for a certificate, use the following command: openssl s_client -connect website.example:443 </dev/null 2>/dev/null | openssl x509 -noout -text | grep DNS: First, this command connects to the site we want (website.example, port 443 for SSL): openssl s_client -connect website.example:443 Then pipe (|) that into this command: openssl x509 … Read more

Creating a .p12 file

The openssl documentation says that file supplied as the -in argument must be in PEM format. Turns out that, contrary to the CA’s manual, the certificate returned by the CA which I stored in myCert.cer is not PEM format rather it is PKCS7. In order to create my .p12, I had to first convert the … Read more