{"id":2531,"date":"2016-01-23T09:32:23","date_gmt":"2016-01-23T14:32:23","guid":{"rendered":"https:\/\/infotechguy.net\/?p=2531"},"modified":"2025-02-22T13:10:47","modified_gmt":"2025-02-22T18:10:47","slug":"1-way-vs-2-way-ssl-authentication","status":"publish","type":"post","link":"https:\/\/infotechguy.net\/?p=2531","title":{"rendered":"Linux &#8212; OpenSSL One,Two-way authentication"},"content":{"rendered":"<h1>Table of Contents<\/h1>\n<ol>\n<li><a href=\"#aboutSSL\">About SSL Authentication<\/a><\/li>\n<li><a href=\"#review\">Quick Review<\/a><\/li>\n<li><a href=\"#CreatingCA\">Creating a Certificate Authority<\/a><\/li>\n<li><a href=\"#1-waySSL\">1-way &#8220;Standard&#8221; SSL Authentication<\/a><\/li>\n<li><a href=\"#2-waySSL\">2-way &#8220;Mutual&#8221; SSL Authentication<\/a><\/li>\n<li><a href=\"#advancedSSL\">Advanced SSL Authentication: CRLs, CDP, and OCSP<\/a><\/li>\n<li><a href=\"#conceptReview\">Concept Review<\/a><\/li>\n<\/ol>\n<h3>About SSL Authentication:<\/h3>\n<p><strong>TLS Authentication<\/strong> or SSL authentication is nothing more than proving the authenticity of one or both parties in the formation of an TLS &#8220;Secure&#8221; \u00a0connection<strong>.<\/strong><\/p>\n<p><strong>1-way &#8220;Standard&#8221; TLS Authentication<\/strong> is the most common, you use this every time you log into Facebook, your bank website, google, etc. The point of this type of authentication is for you (as the client) to verify the authenticity of the web site you are connecting to and form a secure channel of communication.<\/p>\n<p><strong> 2-way &#8220;Mutual&#8221; mTLS Authentication<\/strong> is less common than the traditional &#8220;one-way&#8221; TLS authentication we are a custom to when visiting secured websites. When we connect to our banking website or our favorite web e-mail site, we as the client are verifying the identify of the site we are requesting content from. This &#8220;one-way&#8221; authentication allows us as the client to connect with confidence that the web site we are receiving content from has been verified. this authenticity check is performed by our client browser with a little help from a third-party certificate authority.<\/p>\n<p><strong>Let&#8217;s first review a one-way TLS connection.<\/strong><\/p>\n<ol>\n<li>The Client browsers receives https:\/\/google.com in it&#8217;s address barf<\/li>\n<li>Client browsers knows based on https:\/\/ that this connection will require an SSL handshake and sends a CLIENT_HELLO to the destined web server (google). This includes other things like SSL\/TLS version, acceptable ciphers, etc<\/li>\n<li>The web server receives the CLIENT_HELLO request and sends a SERVER_HELLO back to the client. SERVER_HELLO contains SSL version, acceptable ciphers, and the server certificate.<\/li>\n<li>The client receives the servers certificate and it is verified against a list of known Certificate Authorities.<\/li>\n<li>If the certificate is proven to be in good standing, the client sends back a pre-master secret is encrypted inside the server&#8217;s certificate. Remember only the server can decrypt anything encrypted with it&#8217;s certificate because only the server has the decryption key. Server Certificate encrypts, Server Key decrypt&#8217;s.<\/li>\n<li>At this point both client and server have the pre-master secret and can calculate a master secret to use to symmetrically encrypt and decrypt data between them.<\/li>\n<\/ol>\n<p>So as we can see from a traditional TLS handshake, the client is never verified as authentic. Now, in most situations this is fine, as most connect types of this nature only need to verify the server because that is where the content is coming from.<\/p>\n<p><strong>The difference<\/strong>: In a 2-way mutual authenticated TLS handshake, the server will ask the client to send its own certificate for verification. Just like the client asking for the server&#8217;s certificate in the 1-way TLS handshake above, the server will perform verification of the client certificate before continuing to the pre-master and master secret phase of the SSL handshake. If authenticity of the client cannot be verified the server closes the connection.<\/p>\n<p><strong>How is mutual trust obtained?<\/strong> Both the server and client must generate their own TLS certificate and keys, and both must be signed by the same Certificate Authority. This ensures that both the server and the client&#8217;s certificate are trusted. This allows authentication to remain asymmetrical, instead of symmetrical. For example, rather than have a shared password that 3 clients and the server use to encrypt and decrypt data. Each client and the server have their own certificates and keys that will be used for communication with the server. Asymmetrical authentication and encryption is better at enforcing authenticity because everyone has their own cert and key used to establish a secure connection with the server. Symmetrical authentication is faster at encrypting and decrypting but suffers from having every client use the same key.<\/p>\n<p><strong>What happens if a client key is compromised?<\/strong> In the symmetrical authentication scenario, mentioned previously, you would have a serious security issue on your hands. Each client would be at risk and the likely hood of eavesdropping would increase. An attacker only has to obtain one key to gain visibility into every connection. Asymmetrical on the other hand has a different way of handling this. Because each client has it&#8217;s own certificate and key pair, and the signing of each certificate is performed by a third-party Certificate Authority, one simply has to revoke the compromised client in the form of a CRL certificate(more on this later). Other client connections will not be compromised or have to be re-generated. The server verifying the client certificate will fail only for the revoked for the compromised client.<\/p>\n<p><strong>What happens if my Certificate Authority&#8217;s key is compromised?<\/strong> This is the worst case scenario that can happen in your PKI infrastructure.An attacker can impose and generate a new certificate authority certificate and start signing certificates that can be used to fake authenticity. In essence break the certificate authority&#8217;s\u00a0trust.\u00a0 Keep in mind a Certificate Authority key cannot decrypt your connections.<\/p>\n<p><!--more--><\/p>\n<h3><a name=\"review\"><\/a>Let&#8217;s review&#8230;.<\/h3>\n<ul>\n<li><strong>Certificate Authority<\/strong> is a trustpoint used as a third-party between the parties trying to validate each other&#8217;s authenticity.<\/li>\n<li><strong>Asymmetrical encryption<\/strong> allows us to form a protected trust between two parties that do not need to know anything about each other.<\/li>\n<li><strong>TLS\/SSL Certificates<\/strong> are used for authentication and for the remote party to use to encrypt it&#8217;s first message sent back<\/li>\n<li><strong>TLS\/SSL CA Key<\/strong> is used to sign certificates authorized by a Certificate Authority<\/li>\n<li><strong>TLS\/SSL Key<\/strong> used to decrypt data encrypted by the corresponding SSL Certificate<\/li>\n<li><strong>pre-master<\/strong> secret is used as a starting point in the calculation of the master secret<\/li>\n<li><strong>master secret<\/strong> is used as a symmetrical encryption\/decryption key between both parties, making the process of encryption\/decryption faster<\/li>\n<\/ul>\n<p>I want to show a few scenarios on how to configure 2-way &#8220;Mutual&#8221; authentication. But first, we have to create our Certificate authority trust-point using <strong>openssl<\/strong>. There are otherways to do this, however for demonstration purposes of this post I will be using <strong>openssl<\/strong>.<\/p>\n<h3>Creating our Certificate Authority:<\/h3>\n<ol>\n<li>\n<h6>Housekeeping, create a openssl-rootca.conf file with defaults in it so you don&#8217;t have to re-type them everytime you issue an openssl command.<\/h6>\n<p>Create a openssl-rootca.conf file, <strong>vi \/opt\/openssl-rootca.conf<br \/>\n<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dir\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = \/opt\r\n\r\n[ ca ]\r\ndefault_ca\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = root_ca\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #what stanza to use when issueing openssl ca -cofig openssl-rootca.conf command\r\n\r\n[ root_ca ]\r\n#openssl ca -config openssl-rootca.conf\r\ndatabase\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = $dir\/index.db\r\nserial\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = $dir\/serial\r\ncrlnumber\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = $dir\/crlnumber\r\ncertificate\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = $dir\/rootCA.crt\r\nprivate_key\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = $dir\/rootCA.key\r\nnew_certs_dir\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = $dir\/\r\ndefault_days\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = 365\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #default certificate duration\r\ndefault_md\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = sha256\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #MD to use\r\ndefault_crl_days\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = 30\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #How long before next CRL to check for\r\nemail_in_dn\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = no\r\nunique_subject\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = no\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #Certs can be signed if a subject with the same name already exists\r\ncrl_extensions\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = ca_crl_ext\u00a0\u00a0\u00a0 #default CRL extensions\r\nx509_extensions\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = ca_req_ext\r\npolicy\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = MatchingPolicy #Name of policy to enforce when signing certificates with this CA\r\n\r\n[ req ]\r\n#openssl req -config openssl-rootca.conf\r\ndefault_bits\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = 2048\r\nencrypt_key\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = no\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #only to make things easier for this demonstration\r\ndefault_md\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = sha256\r\nutf8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = yes\r\nstring_mask\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = utf8only\r\nprompt\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = yes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #Prompt for DN input\r\ndistinguished_name\u00a0\u00a0\u00a0\u00a0\u00a0 = ca_dn\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #How to handle the distingushied name when requesting a certificate\r\nx509_extensions\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = ca_req_ext\u00a0\u00a0 #X.509 extensions to use when requesting a certificate\r\n\r\n[ ca_dn ]\r\ncountryName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = Enter Country\r\ncountryName_default\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = US\r\nstateOrProvinceName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = State or Province Name (full name)\r\nstateOrProvinceName_default\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = Connecticut\r\nlocalityName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = Locality Name (eg, city)\r\nlocalityName_default\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = Wethersfield\r\norganizationName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = Organization Name\r\norganizationName_default\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = thejimmahknows\r\norganizationalUnitName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = Unit Name\r\norganizationalUnitName_default\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = Test Unit\r\ncommonName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = Common Name (e.g. server FQDN or YOUR name)\r\nemailAddress\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = Contact email for this Certificate\r\nemailAddress_default\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = admin@example.com\r\n\r\n\r\n[ MatchingPolicy ]\r\n#set's what much match, optional, or must be supplied to Certificates requesting signing\r\ncountryName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = match\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #Must match CA's countryName\r\nstateOrProvinceName\u00a0\u00a0\u00a0\u00a0 = optional\u00a0\u00a0\u00a0\u00a0\u00a0 #optional input\r\nlocalityName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = optional\u00a0\u00a0\u00a0\u00a0\u00a0 #optional input\r\norganizationName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = supplied\u00a0\u00a0\u00a0\u00a0\u00a0 #Must supply organizationName\r\norganizationalUnitName\u00a0 = optional\u00a0\u00a0\u00a0\u00a0\u00a0 #optional input\r\ncommonName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = supplied\u00a0\u00a0\u00a0\u00a0\u00a0 #Must be supplied\r\nemailAddress\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = supplied\u00a0\u00a0\u00a0\u00a0\u00a0 #supplied for contact purposes\r\n\r\n[ ca_req_ext ]\r\n#default req stanza set to CA:true for when we sign our first certificate which is a CA type\r\nbasicConstraints = critical, CA:true\r\nkeyUsage = critical, keyCertSign,cRLsign\r\nsubjectKeyIdentifier = hash\r\nauthorityKeyIdentifier = keyid:always\r\nauthorityInfoAccess = OCSP;URI:http:\/\/ocsp.thejimmahknows.com:8080, caIssuers;URI:http:\/\/ocsp.thejimmahknows.com\/rootCA.crt\r\ncrlDistributionPoints = URI:http:\/\/ocsp.thejimmahknows.com\/rootCRL.crl\r\n\r\n[ server_req_ext ]\r\n#stanza used when specifiying -extension server_req_ext\r\nbasicConstraints = CA:FALSE\r\nkeyUsage = critical,digitalSignature,keyEncipherment\r\nextendedKeyUsage = serverAuth, clientAuth\r\nsubjectKeyIdentifier = hash\r\nauthorityInfoAccess = OCSP;URI:http:\/\/ocsp.thejimmahknows.com:8080, caIssuers;URI:http:\/\/ocsp.thejimmahknows.com\/rootCA.crt\r\ncrlDistributionPoints = URI:http:\/\/ocsp.thejimmahknows.com\/rootCRL.crl\r\n\r\n[ client_req_ext ]\r\n#stanza used when specifiying -extension client_req_ext\r\nbasicConstraints = CA:FALSE\r\nkeyUsage = critical,digitalSignature\r\nextendedKeyUsage = clientAuth\r\nsubjectKeyIdentifier = hash\r\nauthorityKeyIdentifier = keyid,issuer\r\nauthorityInfoAccess = OCSP;URI:http:\/\/ocsp.thejimmahknows.com:8080, caIssuers;URI:http:\/\/ocsp.thejimmahknows.com\/rootCA.crt\r\ncrlDistributionPoints = URI:http:\/\/ocsp.thejimmahknows.com\/rootCA.crl\r\n\r\n[ ca_crl_ext ]\r\n#default stanza for crl_ext\r\nauthorityKeyIdentifier = keyid:always\r\nauthorityInfoAccess = caIssuers;URI:http:\/\/ocsp.thejimmahknows.com\/rootCA.crt\r\n\r\n[ca_ocsp_ext ]\r\n#stanza will be used when issuing openssl ca -config openssl-rootca.conf -extension ca_ocsp_ext\r\nbasicConstraints = CA:FALSE\r\nkeyUsage = critical, digitalSignature\r\nextendedKeyUsage = critical, OCSPSigning\r\nsubjectKeyIdentifier = hash\r\nauthorityKeyIdentifier = keyid:always\r\n<\/pre>\n<p><strong>NOTE<\/strong>: Most of these variables are the defaults pulled from the openssl.conf installed with my distribution.<\/li>\n<li>\n<h6>Creating our CA serial file, this is nothing more than an iteration number to start with when signing certificates.<\/h6>\n<p><em>\u00a0 Making sure each signed certificate from the Certificate Authority has a unique serial number value. In the real world, a Certificate Authority would maintain a list of unique serial numbers for each Certificate it signs. It is only locally significant to the Certificate Authority, other CA&#8217;s will not recognize it. This may be useful to track certificates that you&#8217;ve signed with your Certificate Authority.<\/em><em><br \/>\n<\/em><\/p>\n<pre class=\"EnlighterJSRAW\" title=\"Serial Number file and CRL file\" data-enlighter-language=\"generic\">echo \"1001 &gt; \/opt\/serial\r\necho \"1001\" &gt; \/opt\/crlnumber\r\ntouch \/opt\/index.db<\/pre>\n<ul>\n<li><strong>serial number file<\/strong> = iteration number of signed certificates, has to be an even number of characters (cannot be &#8220;101&#8221;, etc)<\/li>\n<li><strong>crlnumber file<\/strong> =\u00a0 iteration number of the CRL certificate (more on this later)<\/li>\n<li><strong>index.sb file<\/strong> = This is a database file that contains information regarding the certificates that have been signed by the CA and their serial numbers<\/li>\n<\/ul>\n<\/li>\n<li>\n<h6>Generate Certificate Authority&#8217;s key. (<strong>NOTE:<\/strong>\u00a0<em>Recommend 8192 key strength, I used 2048 for this demo to save space<\/em>)<\/h6>\n<pre class=\"EnlighterJSRAW\" title=\"Generate CA key\" data-enlighter-language=\"generic\">openssl genrsa -aes256 -out rootCA.key 2048\r\nGenerating RSA private key, 2048 bit long modulus\r\n...........+++\r\n...+++\r\ne is 65537 (0x10001)\r\nEnter pass phrase for rootCA.key:\r\nVerifying - Enter pass phrase for rootCA.key:<\/pre>\n<\/li>\n<li>\n<h6>Using the CA&#8217;s key, generate a CA certificate to be used for signing purposes in the next steps.<\/h6>\n<pre class=\"EnlighterJSRAW\" title=\"CA Certificate\" data-enlighter-language=\"generic\">openssl req -config openssl-rootca.conf -x509 -new -nodes -key rootCA.key -out rootCA.crt -days 3650\r\nEnter pass phrase for rootCA.key:\r\nYou are about to be asked to enter information that will be incorporated\r\ninto your certificate request.\r\nWhat you are about to enter is what is called a Distinguished Name or a DN.\r\nThere are quite a few fields but you can leave some blank\r\nFor some fields there will be a default value,\r\nIf you enter '.', the field will be left blank.\r\n-----\r\nEnter Country [US]:\r\nState or Province Name (full name) [Connecticut]:\r\nLocality Name (eg, city) [Wethersfield]:\r\nOrganization Name [thejimmahknows]:\r\nUnit Name [Test Unit]:\r\nCommon Name (e.g. server FQDN or YOUR name) []:MyRootAuthority \r\nContact email for this Certificate [admin@example.com]:\r\n\r\n<\/pre>\n<p><strong>NOTE:<\/strong> the <strong>-config openssl-rootca.conf<\/strong> uses our Housekeeping config file we created above to get it&#8217;s options from.<\/li>\n<\/ol>\n<h3><a name=\"1-waySSL\"><\/a>1-way &#8220;Standard&#8221; SSL Authentication<\/h3>\n<ol>\n<li>\n<h6>Generate our web-server certificate and CSR for signing by our CA we created above<\/h6>\n<pre class=\"EnlighterJSRAW\" title=\"Generate Web server Key and CSR \" data-enlighter-language=\"generic\">openssl req -config openssl-rootca.conf -extensions server_req_ext -new -nodes -newkey rsa:2048 -keyout web-server.key -out -web-server.csr -days 365  \r\nGenerating a 2048 bit RSA private key\r\n.............................+++\r\n........................................................................+++\r\nwriting new private key to 'web-server.key'\r\n-----\r\nYou are about to be asked to enter information that will be incorporated\r\ninto your certificate request.\r\nWhat you are about to enter is what is called a Distinguished Name or a DN.\r\nThere are quite a few fields but you can leave some blank\r\nFor some fields there will be a default value,\r\nIf you enter '.', the field will be left blank.\r\n-----\r\nEnter Country [US]:\r\nState or Province Name (full name) [Connecticut]:\r\nLocality Name (eg, city) [Wethersfield]:\r\nOrganization Name [thejimmahknows]:\r\nUnit Name [Test Unit]:\r\nCommon Name (e.g. server FQDN or YOUR name) []:web-server\r\nContact email for this Certificate [admin@example.com]:\r\n<\/pre>\n<\/li>\n<li>\n<h6>Sign our web-server certificate with our MyRootAuthority CA from the previous section<\/h6>\n<pre class=\"EnlighterJSRAW\" title=\"Sign web-server certificate\" data-enlighter-language=\"generic\">openssl ca -config openssl-rootca.conf -extensions server_req_ext -in web-server.csr -out web-server.crt\r\nUsing configuration from openssl-rootca.conf\r\nEnter pass phrase for \/opt\/rootCA.key:\r\nCheck that the request matches the signature\r\nSignature ok\r\nThe Subject's Distinguished Name is as follows\r\ncountryName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :PRINTABLE:'US'\r\nstateOrProvinceName\u00a0\u00a0 :ASN.1 12:'Connecticut'\r\nlocalityName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :ASN.1 12:'Wethersfield'\r\norganizationName\u00a0\u00a0\u00a0\u00a0\u00a0 :ASN.1 12:'thejimmahknows'\r\norganizationalUnitName:ASN.1 12:'Test Unit'\r\ncommonName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :ASN.1 12:'web-server'\r\nCertificate is to be certified until Jan 15 17:38:33 2017 GMT (365 days)\r\nSign the certificate? [y\/n]:y\r\n\r\n\r\n1 out of 1 certificate requests certified, commit? [y\/n]y\r\nWrite out database with 1 new entries\r\nData Base Updated\r\n<\/pre>\n<\/li>\n<li>\n<h6>Check our web-server Certificate<\/h6>\n<pre class=\"EnlighterJSRAW\" title=\"Check web-server certificate\" data-enlighter-language=\"generic\">openssl x509 -noout -text -in web-server.crt\r\nCertificate:\r\n\u00a0\u00a0\u00a0 Data:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Version: 3 (0x2)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Serial Number: 4097 (0x1001)\r\n\u00a0\u00a0\u00a0 Signature Algorithm: sha256WithRSAEncryption\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Issuer: C=US, ST=Connecticut, L=Wethersfield, O=thejimmahknows, OU=Test Unit, CN=MyRootAuthority\/emailAddress=admin@example.com\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Validity\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Not Before: Jan 16 17:38:33 2016 GMT\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Not After : Jan 15 17:38:33 2017 GMT\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Subject: C=US, ST=Connecticut, L=Wethersfield, O=thejimmahknows, OU=Test Unit, CN=web-server\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Subject Public Key Info:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Public Key Algorithm: rsaEncryption\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Public-Key: (2048 bit)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Modulus:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 00:ec:79:7f:d8:6f:70:05:1b:71:2e:da:74:73:4d:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0b:54:5f:b2:ae:93:5d:21:2f:a3:5d:79:c0:ee:03:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3d:ec:87:54:4d:0b:e6:0e:8b:1f:3a:af:ff:e7:f2:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4b:dc:f4:e0:59:fc:5e:1b:3a:5e:5e:b7:b5:72:ed:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3e:e3:63:22:9f:d4:1c:c5:ed:fa:dc:4e:14:66:76:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 f5:87:2c:e5:57:4c:3a:4a:db:c8:03:6d:b1:f5:1b:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 73:01:2e:89:5d:fb:bc:a4:a9:d4:7d:c4:40:95:26:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 a8:62:3f:27:bb:7f:b3:23:70:bf:12:29:74:7c:ee:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0d:9d:aa:29:33:3f:f5:b7:09:da:5c:e0:0a:b1:c2:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 81:bd:cc:c3:a1:f7:27:cb:75:9a:c1:4a:0b:1b:c7:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4b:2f:de:3a:e9:51:c0:ee:e1:97:f3:0d:ac:6d:65:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0e:9c:90:46:c7:64:8b:31:ae:01:54:63:11:42:0f:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 5b:13:9a:6a:a7:f0:fc:96:1a:7e:ea:92:44:0b:a9:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 53:a2:40:39:98:f2:91:dd:34:af:0a:d5:7b:b3:ab:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 dd:3f:bd:e4:b6:e2:8e:6e:05:37:e4:f8:24:85:4f:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 dd:fa:c5:93:f4:e5:1f:36:cf:88:27:fa:41:07:f1:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 7e:22:ca:1c:0d:e8:fc:80:c1:18:c0:54:1f:82:8a:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ea:1f\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Exponent: 65537 (0x10001)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 extensions:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 Basic Constraints:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CA:FALSE\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 Key Usage: critical\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Digital Signature, Key Encipherment\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 Extended Key Usage:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 TLS Web Server Authentication, TLS Web Client Authentication\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 Subject Key Identifier:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 20:33:8C:4A:B5:F2:EE:B1:59:3C:EC:0B:C3:79:09:8A:09:E6:59:70\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Authority Information Access:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 OCSP - URI:http:\/\/ocsp.thejimmahknows.com\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CA Issuers - URI:http:\/\/ocsp.thejimmahknows.com\/rootCA.crt\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 CRL Distribution Points:\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Full Name:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 URI:http:\/\/ocsp.thejimmahknows.com\/rootCRL.crl\r\n\r\n\u00a0\u00a0\u00a0 Signature Algorithm: sha256WithRSAEncryption\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 00:3b:dd:ca:db:14:3e:44:72:14:36:b8:99:03:2a:8f:aa:b2:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4d:68:3e:06:ad:db:c5:16:c4:92:aa:d2:d6:96:fe:83:81:dc:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 e8:86:f8:eb:6d:cd:d9:f4:77:4d:8f:99:6a:04:db:ee:3e:62:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9d:a9:64:72:4e:8b:0b:ea:71:2e:2c:1e:93:1d:4f:6d:af:32:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 27:53:ae:13:54:0d:e5:10:bc:ea:2c:e1:0d:01:63:5b:bf:75:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 11:cd:d6:f3:de:31:bd:25:eb:88:42:b0:df:e5:45:0a:85:3a:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bf:01:bd:33:7c:ad:e3:a6:48:0c:28:fe:f9:c4:2b:55:ff:8d:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 b5:fd:79:d3:f4:98:22:7a:c7:58:e7:d3:b4:71:89:c7:1c:a6:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 42:fc:ab:a9:03:02:29:73:21:21:70:83:bf:f9:96:bb:fa:68:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bf:77:11:55:2f:50:89:35:2d:0f:00:dd:f4:62:a0:1e:25:be:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ec:67:3c:b9:25:eb:55:13:a0:59:5a:45:1e:87:aa:3a:40:d1:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 75:3b:f9:65:6b:fe:bd:78:39:26:61:a5:54:2c:43:d5:c8:f0:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 21:96:dd:26:f5:8a:da:9f:fd:a7:21:65:15:a0:c9:3c:16:f6:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9f:e5:60:79:db:58:88:bd:fa:c7:c7:de:1a:f6:06:63:45:28:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 f3:31:d6:82\r\n<\/pre>\n<\/li>\n<li>\n<h6>\u00a0Check the index.db file, So far so good!<\/h6>\n<pre class=\"EnlighterJSRAW\" title=\"index.db file\" data-enlighter-language=\"generic\">cat \/opt\/index.db\r\nV\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 170115175505Z\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1001\u00a0\u00a0\u00a0 unknown \/C=US\/ST=Connecticut\/L=Wethersfield\/O=thejimmahknows\/OU=Test Unit\/CN=web-server\r\n<\/pre>\n<p><strong>V = Valid, <\/strong><strong>R = Revoked<\/strong><\/li>\n<li>\n<h6>Configure our Apache2 Web-Server to use the certificate we just signed:<\/h6>\n<pre class=\"EnlighterJSRAW\" title=\"1-way Apache Configuration\" data-enlighter-language=\"generic\">vi \/etc\/apache2\/site-available\/default.conf\r\n\r\n&lt;VirtualHost *:443&gt;\r\n        DocumentRoot           \"\/var\/www\/\"\r\n\r\n        SSLEngine             on\r\n        SSLCACertificateFile   \/opt\/rootCA.crt\r\n        SSLCertificateFile     \/opt\/web-server.crt\r\n        SSLCertificateKeyFile  \/opt\/web-server.key\r\n\r\n        # Allows PHP to read Certificate info\r\n        SSLOptions +stdEnvVars\r\n\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<ul>\n<li><strong>DocumentRoot<\/strong> = Where our webpage files are kept<\/li>\n<li><strong>SSLEngine<\/strong> = Enabled mod_ssl which is needed to have apache respond to SSL type requests<\/li>\n<li><strong>SSLCACertificateFile<\/strong> = The Location of our CA certificate<\/li>\n<li><strong>SSLCertificateFile<\/strong> = Location of the web-server.crt file<\/li>\n<li><strong>SSLCertificateKeyFile<\/strong> = Location of the web-server.key file<\/li>\n<li><strong>SSLOptions +stdEnvVars<\/strong> = This allows our index.php file to read from the Web-Server&#8217;s system variables, this is required because SSL information is happening at Layer 4, where HTTP is happening at Layer<\/li>\n<li><a href=\"http:\/\/httpd.apache.org\/docs\/2.2\/mod\/mod_ssl.html\" target=\"_blank\" rel=\"noopener noreferrer\">See more Apache2.2 mod_ssl options here.<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\n<h6>Let&#8217;s create a index.php to help us check on the certificates used to connect to the web-server:<\/h6>\n<pre class=\"EnlighterJSRAW\" title=\"index.php\" data-enlighter-language=\"generic\">vi \/var\/www\/index.php \r\n\r\n&lt;?php\r\necho \"Date       =   \" . date('Y-m-d H:i:s') . \"&lt;br&gt;\";\r\necho \"Client Cert =  \" . $_SERVER['SSL_CLIENT_S_DN_CN'] . \"&lt;br&gt;\";\r\necho \"Server Cert =  \" . $_SERVER['SSL_SERVER_S_DN_CN'] . \"&lt;br&gt;\";\r\necho \"Server Serial =\u00a0 \" . $_SERVER['SSL_SERVER_M_SERIAL'] . \"&lt;br&gt;\";\r\n?&gt;<\/pre>\n<\/li>\n<li>\n<h6>Testing with Firefox<\/h6>\n<p><a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox1-Way-Untrusted.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3307\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox1-Way-Untrusted-300x163.png\" alt=\"\" width=\"600\" height=\"326\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox1-Way-Untrusted-300x163.png 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox1-Way-Untrusted-1024x557.png 1024w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox1-Way-Untrusted-768x417.png 768w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox1-Way-Untrusted.png 1378w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><br \/>\n<strong>N<\/strong><strong>ote<\/strong>: &#8220;This Connection is Untrusted&#8221; makes sense, since Firefox has a list of Trusted Certificate Authorities and our <strong>MyRootAuthority<\/strong> we created is not one of them. We&#8217;ll add the MyRootAuthority in the next steps and re-check!<\/li>\n<li>\n<h6>Adding the rootCA certificate to Firefox&#8217;s trusted authorities.<\/h6>\n<p>This is effectively the same as if you had GoDaddy or another CA sign your certificate since these third-parties root CA certificates are already loaded in your browser.<br \/>\n<a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3309\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox-300x203.jpg\" alt=\"\" width=\"600\" height=\"407\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox-300x203.jpg 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox-1024x694.jpg 1024w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox-768x521.jpg 768w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox.jpg 1431w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a> <a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3310\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox2-300x157.jpg\" alt=\"\" width=\"600\" height=\"313\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox2-300x157.jpg 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox2-1024x534.jpg 1024w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox2-768x401.jpg 768w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Adding-root-CA-to-Firefox2.jpg 1200w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/li>\n<li>\n<h6>Re-test<\/h6>\n<p><a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/indexfile-1way-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3311\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/indexfile-1way-2-300x198.png\" alt=\"\" width=\"488\" height=\"322\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/indexfile-1way-2-300x198.png 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/indexfile-1way-2.png 394w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><\/a><br \/>\n<strong>A<\/strong><strong>lrighty!!<\/strong> So our web-server certificate is now verified trusted by our MyRootAuthority in Firefox!! <strong>Remember,<\/strong> this is the same way a GoDaddy or VeriSign certificate would be verified, your browser actually has all those Trusted CA Certificates locally to use when connecting to servers.<\/li>\n<\/ol>\n<h3><a name=\"2-waySSL\"><\/a>2-way &#8220;Mutual&#8221; Authentication<\/h3>\n<p>Moving on to 2-way &#8220;Mutual&#8221; Authentication is actually fairly straight forward as well. We only have to keep in mind a couple of things along the way. First, both our Web-Server certificate and our Client certificates must be signed by the same Certificate Authority (If using GoDaddy or Verisign works as well). Second we must make sure our host acting as a server in this client\/server relationship enforces client SSL authentication, which we will be done by our Web-Server running Apache2. Let&#8217;s get to it!<\/p>\n<ol>\n<li>\n<h6>Generate a few client certificates and CSR for signing by our CA.<\/h6>\n<ul>\n<li><strong>Client1<\/strong>\n<pre class=\"EnlighterJSRAW\" title=\"Generate Client 1 Key and CSR\" data-enlighter-language=\"generic\">openssl req -config openssl-rootca.conf -extensions client_req_ext -new -nodes -newkey rsa:2048 -keyout client1.key -out client1.csr -days 365\r\nGenerating a 2048 bit RSA private key\r\n...............................................................................+++\r\n.....................................+++\r\nwriting new private key to 'client1.key'\r\n-----\r\nYou are about to be asked to enter information that will be incorporated\r\ninto your certificate request.\r\nWhat you are about to enter is what is called a Distinguished Name or a DN.\r\nThere are quite a few fields but you can leave some blank\r\nFor some fields there will be a default value,\r\nIf you enter '.', the field will be left blank.\r\n-----\r\nEnter Country [US]:\r\nState or Province Name (full name) [Connecticut]:\r\nLocality Name (eg, city) [Wethersfield]:\r\nOrganization Name [thejimmahknows]:\r\nUnit Name [Test Unit]:\r\nCommon Name (e.g. server FQDN or YOUR name) []:client1\r\nContact email for this Certificate [admin@example.com]:\r\n<\/pre>\n<\/li>\n<li><strong>Client2<\/strong>\n<pre class=\"lang:default decode:true\" title=\"Generate Client 2 Key and CSR\">openssl req -config openssl-rootca.conf -extensions client_req_ext -new -nodes -newkey rsa:2048 -keyout client2.key -out client2.csr -days 365\r\nGenerating a 2048 bit RSA private key\r\n..................................................................................................................................................................+++\r\n....+++\r\nwriting new private key to 'client2.key'\r\n-----\r\nYou are about to be asked to enter information that will be incorporated\r\ninto your certificate request.\r\nWhat you are about to enter is what is called a Distinguished Name or a DN.\r\nThere are quite a few fields but you can leave some blank\r\nFor some fields there will be a default value,\r\nIf you enter '.', the field will be left blank.\r\n-----\r\nEnter Country [US]:\r\nState or Province Name (full name) [Connecticut]:\r\nLocality Name (eg, city) [Wethersfield]:\r\nOrganization Name [thejimmahknows]:\r\nUnit Name [Test Unit]:\r\nCommon Name (e.g. server FQDN or YOUR name) []:client2\r\nContact email for this Certificate [admin@example.com]:<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<h6>Sign our Client CSRs to obtain each client certificate.<\/h6>\n<ul>\n<li><strong>Client1<\/strong>\n<pre class=\"EnlighterJSRAW\" title=\"Signing client1 Certificate\" data-enlighter-language=\"generic\">openssl ca -config openssl-rootca.conf -extensions client_req_ext -out client1.crt -in client1.csr\r\nUsing configuration from openssl-rootca.conf\r\nEnter pass phrase for \/opt\/rootCA.key:\r\nCheck that the request matches the signature\r\nSignature ok\r\nThe Subject's Distinguished Name is as follows\r\ncountryName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :PRINTABLE:'US'\r\nstateOrProvinceName\u00a0\u00a0 :ASN.1 12:'Connecticut'\r\nlocalityName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :ASN.1 12:'Wethersfield'\r\norganizationName\u00a0\u00a0\u00a0\u00a0\u00a0 :ASN.1 12:'thejimmahknows'\r\norganizationalUnitName:ASN.1 12:'Test Unit'\r\ncommonName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :ASN.1 12:'client1'\r\nemailAddress\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :IA5STRING:'admin@example.com'\r\nCertificate is to be certified until Jan 12 20:21:01 2017 GMT (365 days)\r\nSign the certificate? [y\/n]:y\r\n\r\n\r\n1 out of 1 certificate requests certified, commit? [y\/n]y\r\nWrite out database with 1 new entries\r\nData Base Updated<\/pre>\n<\/li>\n<li><strong>Client2<\/strong>\n<pre class=\"EnlighterJSRAW\" title=\"Client2 signing Certificate\" data-enlighter-language=\"generic\">openssl ca -config openssl-rootca.conf -extensions client_req_ext -out client2.crt -in client2.csr\r\nUsing configuration from openssl-rootca.conf\r\nEnter pass phrase for \/opt\/rootCA.key:\r\nCheck that the request matches the signature\r\nSignature ok\r\nThe Subject's Distinguished Name is as follows\r\ncountryName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :PRINTABLE:'US'\r\nstateOrProvinceName\u00a0\u00a0 :ASN.1 12:'Connecticut'\r\nlocalityName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :ASN.1 12:'Wethersfield'\r\norganizationName\u00a0\u00a0\u00a0\u00a0\u00a0 :ASN.1 12:'thejimmahknows'\r\norganizationalUnitName:ASN.1 12:'Test Unit'\r\ncommonName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :ASN.1 12:'client2'\r\nemailAddress\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :IA5STRING:'admin@example.com'\r\nCertificate is to be certified until Jan 12 20:26:20 2017 GMT (365 days)\r\nSign the certificate? [y\/n]:y\r\n\r\n\r\n1 out of 1 certificate requests certified, commit? [y\/n]y\r\nWrite out database with 1 new entries\r\nData Base Updated\r\n<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<h6>Check the database file, index.txt<\/h6>\n<pre class=\"EnlighterJSRAW\" title=\"Index.txt database file\" data-enlighter-language=\"generic\">cat \/opt\/index.db\r\nV\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 170115175505Z\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1001\u00a0\u00a0\u00a0 unknown \/C=US\/ST=Connecticut\/L=Wethersfield\/O=thejimmahknows\/OU=Test Unit\/CN=web-server\r\nV\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 170115181345Z\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1002\u00a0\u00a0\u00a0 unknown \/C=US\/ST=Connecticut\/L=Wethersfield\/O=thejimmahknows\/OU=Test Unit\/CN=client1\r\nV\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 170115181400Z\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1003\u00a0\u00a0\u00a0 unknown \/C=US\/ST=Connecticut\/L=Wethersfield\/O=thejimmahknows\/OU=Test Unit\/CN=client<\/pre>\n<p><strong>NOTE<\/strong>: See the list of certificates we just signed and their corresponding serial numbers (starting with 1001).<\/li>\n<li>\n<h6>Modify our Apache2.conf file to Enforce Client SSL Verification<\/h6>\n<pre class=\"EnlighterJSRAW\" title=\"Apache2.conf with Client Verify\" data-enlighter-language=\"generic\">vi \/etc\/apache2\/sites-available\/default.conf\r\n\r\nListen 443\r\n&lt;VirtualHost *:443&gt;\r\n        DocumentRoot           \"\/var\/www\/\"\r\n        ServerName              web-server\r\n\r\n        SSLEngine               on\r\n        SSLCACertificateFile   \/opt\/rootCA.crt\r\n        SSLCertificateFile     \/opt\/web-server.crt\r\n        SSLCertificateKeyFile  \/opt\/web-server.key\r\n#       SSLCARevocationFile    \/opt\/rootCRL.crl\r\n        SSLStrictSNIVHostCheck on\r\n        SSLVerifyClient        require\r\n        SSLVerifyDepth         1\r\n# Allows PHP to read Certificate info\r\n        SSLOptions +stdEnvVars\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p><strong>Let&#8217;s walk through what we changed.<\/strong><\/p>\n<ul>\n<li><strong>SSLCACertficateFile<\/strong> = Only the rootCA.crt file from above is required, the rootCA.key is only used when signing certificates to be seen as valid.<\/li>\n<li><strong>SSLCARevocationFile<\/strong> = The location of the CRL certificate file denoting revoked certificates. (More on this later), it is commented out for now&#8230;<\/li>\n<li><strong>*SSLCARevocationPath<\/strong> = If we were not\u00a0 using a browser as our client in this case and rather a server, such as Apache2-to-Apache2 communication, you can use this option to tell Apache to use this path as the CRL path of the far end.<\/li>\n<li><strong>SSLStrictSNIVHostCheck<\/strong> = Sets whether or not the client is allowed to access the VirtualHost if the name doesn&#8217;t match.<\/li>\n<li><strong>SSLVerifyClient<\/strong> = Does the client need to present a Certificate. Required, means certificate has to be validated.<\/li>\n<li><strong>SSLVerifyDepth<\/strong> = Tells Apache how deep it should verify before deciding if the client connection has a valid certificate. (In some scenarios you may have a Root CA, a Intermediate CA, a sub CA, etc)<\/li>\n<li><strong>SSLOptions +stdEnvVars<\/strong> = This allows our<strong> index.php<\/strong> file to read from the Web-Server&#8217;s system variables, this is required because SSL information is happening at Layer 4, where HTTP is happening at Layer 7.<\/li>\n<li>More information, see <a href=\"http:\/\/httpd.apache.org\/docs\/2.2\/mod\/mod_ssl.html\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/httpd.apache.org\/docs\/2.2\/mod\/mod_ssl.html<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\n<h6>Let&#8217;s do a quick test&#8230;.<\/h6>\n<p><a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox2-Way-Untrusted.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3312\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox2-Way-Untrusted-300x288.jpg\" alt=\"\" width=\"600\" height=\"577\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox2-Way-Untrusted-300x288.jpg 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox2-Way-Untrusted-768x738.jpg 768w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox2-Way-Untrusted.jpg 975w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><strong>O No!!! Our connection was reject because we didn&#8217;t supply a Cilent Certificate to the Web-Server<br \/>\n<\/strong><\/li>\n<li>\n<h6>Prepare our Client Certificates<\/h6>\n<ul>\n<li><strong>Create a PKCS12 file containing both the client certificate and key to be imported into Firefox<\/strong>\n<pre class=\"EnlighterJSRAW\" title=\"Create client1.pem\" data-enlighter-language=\"generic\">openssl pkcs12 -export -out client1.pfx -inkey client1.key -in client1.crt\r\nEnter Export Password:\r\nVerifying - Enter Export Password:<\/pre>\n<\/li>\n<li><strong>Copy it and import it into Firefox, like this&#8230;<br \/>\n<\/strong><a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Import-Client-Certificate.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3313\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Import-Client-Certificate-300x210.jpg\" alt=\"\" width=\"600\" height=\"419\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Import-Client-Certificate-300x210.jpg 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Import-Client-Certificate-1024x716.jpg 1024w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Import-Client-Certificate-768x537.jpg 768w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Import-Client-Certificate.jpg 1461w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/li>\n<li><strong>Refresh the Page and Choose the certificate we just imported<\/strong><br \/>\n<a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Choose-Certificate-Firefox.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3314\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Choose-Certificate-Firefox-300x179.jpg\" alt=\"\" width=\"600\" height=\"358\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Choose-Certificate-Firefox-300x179.jpg 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Choose-Certificate-Firefox-1024x611.jpg 1024w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Choose-Certificate-Firefox-768x458.jpg 768w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Choose-Certificate-Firefox.jpg 1263w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/li>\n<li><strong>Success!!! and Success!!<br \/>\n<a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/2-way-SSLAuthentication-Success.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3316\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/2-way-SSLAuthentication-Success-300x147.png\" alt=\"\" width=\"600\" height=\"294\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/2-way-SSLAuthentication-Success-300x147.png 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/2-way-SSLAuthentication-Success.png 491w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><br \/>\n<\/strong><\/li>\n<li><strong>Add the client2.pfx to Firefox<\/strong>\n<ul>\n<li>Using the same steps above convert the client2.crt and client2.key into a <strong>client.pfx<\/strong> file and<strong> copy it into Firefox<\/strong>.\n<pre class=\"lang:default decode:true\" title=\"client2.pfx\">openssl pkcs12 -export -out client2.pfx -inkey client2.key -in client2.crt<\/pre>\n<p><a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Import-Client-Certificate2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3317\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Import-Client-Certificate2-300x211.jpg\" alt=\"\" width=\"600\" height=\"422\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Import-Client-Certificate2-300x211.jpg 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Import-Client-Certificate2.jpg 578w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/li>\n<\/ul>\n<ul>\n<li>Browse to the web-site again you will be prompted to choose which Client Certificate to authenticate with..(You may have to restart Firefox)<a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Choosing-Between2-Certificate.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3318\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Choosing-Between2-Certificate-300x235.jpg\" alt=\"\" width=\"600\" height=\"470\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Choosing-Between2-Certificate-300x235.jpg 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Choosing-Between2-Certificate.jpg 510w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><br \/>\n<strong>NOTICE:<\/strong> As we can see from out PHP page, the server is receiving our Client #2 Certificate<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3><a name=\"advancedSSL\"><\/a>Advanced SSL Authentication:<\/h3>\n<ul>\n<li>\n<h6>\u00a0Certificate Revocation List<\/h6>\n<ul>\n<li>So the last SSL Authentication item I wanted to go over is\u00a0the generation and use of Certificate Revocation Lists(CRL). A CRL is used to provide either party a list of certificates that have been revoked by the Certificate Authority. As you can recall, once a certificate is signed by a Certificate Authority(CA) it is known to be trusted, and there is nothing stopping the information regarding a certificate and if it&#8217;s been\u00a0revoked\u00a0and shouldn&#8217;t be trusted. <strong>CRL<\/strong> to the rescue!!. There are several ways to make each party aware of the CRL, one can copy the file to both parties and when a new CRL is generated copy it to only the parties that are trusted(i.e. don&#8217;t copy it to a party you just revoked!). The other way we can distribute the CRL is make the CRL file publicially accessible via the web, such as http:\/\/web-server\/crl.pem or something similar and have a manual download periodically. We also will have to regenerate our CRL everytime we want to revoke a certificate that has been signed by this Certificate Authority, regenerating our CRL &#8220;updates&#8221; our CRL file with the most current list of revoked certificates under this CA. As you might be thinking, this seems really labor intensive on Administrators&#8230;and you are right! Escpecially in scenarios with over 100 client certificates, etc. Later we will review two(2) common ways we can automatically distribute Revocation Lists, but for now let&#8217;s do it by hand.<\/li>\n<li><strong>Generating our CRL<\/strong>\n<pre class=\"lang:default decode:true\" title=\"Generate our CRL\">openssl ca -config openssl-rootca.conf -gencrl -out rootCRL.crl\r\nUsing configuration from openssl-rootca.conf\r\nEnter pass phrase for \/opt\/rootCA.key:<\/pre>\n<pre class=\"EnlighterJSRAW\" title=\"CRL.pem\" data-enlighter-language=\"generic\">openssl crl -in rootCRL.crl -noout -text\r\nCertificate Revocation List (CRL):\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Version 2 (0x1)\r\n\u00a0\u00a0\u00a0 Signature Algorithm: sha256WithRSAEncryption\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Issuer: \/C=US\/ST=Connecticut\/L=Wethersfield\/O=thejimmahknows\/OU=Test Unit\/CN=MyRootAuthority\/emailAddress=admin@example.com\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Last Update: Jan 16 18:50:22 2016 GMT\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Next Update: Feb 15 18:50:22 2016 GMT\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CRL extensions:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 Authority Key Identifier:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 keyid:E3:A6:FD:69:23:0A:25:AF:7B:77:7A:B8:03:0B:B6:8A:CF:F2:B2:B8\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Authority Information Access:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CA Issuers - URI:http:\/\/ocsp.thejimmahknows.com\/rootCA.crt\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 CRL Number:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4097\r\nNo Revoked Certificates.\r\n\u00a0\u00a0\u00a0 Signature Algorithm: sha256WithRSAEncryption\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 25:7c:50:9c:09:9d:a2:a6:4d:81:0a:87:24:eb:24:35:f8:80:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 e1:a2:4f:c2:39:a9:3b:dc:fb:d5:ab:ff:54:f7:26:4f:b1:9f:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 17:d5:99:85:74:05:2a:e1:dc:67:54:9d:29:2d:b6:26:44:bf:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1a:1f:d8:2c:96:cd:f4:8d:fe:44:26:d0:d1:df:d9:13:96:40:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 23:a5:bf:d9:20:29:03:d9:5b:57:49:60:22:8e:67:0d:51:f4:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0c:da:81:6f:ca:f9:d6:93:b6:b5:a5:f3:5a:bb:67:b7:1f:ef:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 11:e4:36:38:81:60:45:fe:97:69:ae:2e:07:c9:0a:4e:4b:80:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 05:d8:62:c3:32:99:51:15:e2:0b:ff:ff:05:55:3e:fa:28:4c:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 b4:35:e9:bf:db:85:f0:1c:bc:7c:79:50:7c:3a:16:a4:b7:25:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 23:df:76:03:f7:7c:0a:75:bb:56:b1:cd:1a:b0:ca:e1:26:04:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 51:0a:0b:ff:e7:8c:2f:41:2d:d4:a2:3a:43:58:61:03:fa:a1:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6e:ba:e8:60:15:14:e9:9f:fe:2e:d8:55:4b:4f:7d:5c:24:b1:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 13:47:89:23:87:5f:c0:8e:56:88:eb:a6:d1:86:bb:9a:2b:be:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9d:c5:05:70:ce:10:d1:3f:6f:8f:84:1e:21:63:1c:5b:e8:95:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 99:df:20:9c\r\n<\/pre>\n<p><strong>NOTE:<\/strong> Take a look at the Certificate<strong>(cat \/opt\/rootCRL.crl)<\/strong> and it is prefixed with BEGIN X509 CRL to tell us what type of certificate it is.<\/li>\n<li><strong>Activate CRL checking in Apache2 with the SSLCARevocationFile option<\/strong>\n<pre class=\"EnlighterJSRAW\" title=\"Addint CRL to apache2\" data-enlighter-language=\"generic\">vi \/etc\/apache2\/sites-available\/default.conf\r\n\r\nListen 443\r\n&lt;VirtualHost *:443&gt;\r\n        DocumentRoot           \"\/var\/www\/\"\r\n        ServerName              web-server\r\n\r\n        SSLEngine               on\r\n        SSLCACertificateFile   \/opt\/rootCA.crt\r\n        SSLCertificateFile     \/opt\/web-server.crt\r\n        SSLCertificateKeyFile  \/opt\/web-server.key\r\n        SSLCARevocationFile    \/opt\/crl.pem\r\n        SSLStrictSNIVHostCheck on\r\n        SSLVerifyClient        require\r\n        SSLVerifyDepth         1\r\n# Allows PHP to read Certificate info\r\n        SSLOptions +stdEnvVars\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p><strong>NOTE:<\/strong> As of right now, you will still be able to connect with Firefox using either the <strong>client1.pfx<\/strong> or the<strong> client2.pfx<\/strong>.<\/li>\n<li><strong>Revoke the client2 Certificate<\/strong>\n<pre class=\"EnlighterJSRAW\" title=\"Revoke Client 2 Certificate\" data-enlighter-language=\"generic\">openssl ca -config openssl-rootca.conf -revoke client2.crt \r\nUsing configuration from openssl-rootca.conf\r\nEnter pass phrase for \/opt\/rootCA.key:\r\nRevoking Certificate 1003.\r\nData Base Updated\r\n<\/pre>\n<p><strong>We are not done yet<\/strong>, we can still access the web-server because a new CRL has not be generated.<\/p>\n<pre class=\"EnlighterJSRAW\" title=\"Backup and Generate new CRL\" data-enlighter-language=\"generic\">cp \/opt\/rootCRL.crl \/opt\/rootCRL.crl.old\r\n\r\nopenssl ca -config openssl-rootca.conf -gencrl -out rootCRL.crl\r\nUsing configuration from openssl-rootca.conf\r\nEnter pass phrase for \/opt\/rootCA.key:\r\n<\/pre>\n<pre class=\"EnlighterJSRAW\" title=\"Check CRL file after revoke\" data-enlighter-language=\"generic\">\u00a0openssl crl -noout -text -in rootCRL.crl\r\nCertificate Revocation List (CRL):\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Version 2 (0x1)\r\n\u00a0\u00a0\u00a0 Signature Algorithm: sha256WithRSAEncryption\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Issuer: \/C=US\/ST=Connecticut\/L=Wethersfield\/O=thejimmahknows\/OU=Test Unit\/CN=MyRootAuthority\/emailAddress=admin@example.com\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Last Update: Jan 16 18:58:21 2016 GMT\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Next Update: Feb 15 18:58:21 2016 GMT\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CRL extensions:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 Authority Key Identifier:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 keyid:E3:A6:FD:69:23:0A:25:AF:7B:77:7A:B8:03:0B:B6:8A:CF:F2:B2:B8\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Authority Information Access:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CA Issuers - URI:http:\/\/ocsp.thejimmahknows.com\/rootCA.crt\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 CRL Number:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4098\r\nRevoked Certificates:\r\n\u00a0\u00a0\u00a0 Serial Number: 1003\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Revocation Date: Jan 16 18:55:22 2016 GMT\r\n\u00a0\u00a0\u00a0 Signature Algorithm: sha256WithRSAEncryption\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 55:a4:8e:b1:ae:0f:a6:4d:10:1a:95:4f:a9:75:57:c1:8d:f4:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1f:77:bc:c8:e4:41:cf:96:19:75:10:5a:1b:79:0b:cb:cb:7d:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 74:f7:f7:2a:77:93:ec:c5:61:bd:30:32:3b:ce:5c:ba:d7:7c:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 76:61:4b:82:54:3a:c0:da:02:2c:88:28:f9:59:c4:a3:da:39:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 92:31:25:90:ab:57:80:48:b1:80:2a:ea:62:07:4e:ad:0b:54:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ad:79:51:33:2a:b1:11:c5:0a:5b:f2:57:71:01:30:ac:cf:25:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 45:c0:ac:59:3a:58:b0:61:71:eb:4d:9b:68:5b:d7:47:4e:fb:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 67:06:7a:6d:79:87:58:7f:e3:83:1a:c9:ea:21:8f:dd:48:dd:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ae:7a:07:88:37:90:0f:44:fc:fd:8c:a4:5d:5c:53:10:fb:03:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 b0:c5:f7:b5:08:3b:be:97:bd:ee:ff:a0:14:01:0f:cd:31:44:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 f7:c6:71:e6:ab:9b:13:20:d2:d6:88:89:5f:ca:a2:44:b6:a0:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 01:dd:13:ed:b7:40:48:32:76:73:51:2c:21:b1:74:4d:8b:ab:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 a0:fb:a3:c3:1e:7f:2e:5b:c4:1e:a3:e2:50:d6:9e:9d:69:51:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 d8:6e:57:9e:39:7f:31:38:95:f3:c3:63:5b:33:14:10:44:ae:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 db:e8:e5:de\r\n<\/pre>\n<p><strong>NOTE:<\/strong> See the Revoked Certificates section? That is where a list of Certificates with their Serial Number will be listed.<\/li>\n<li><strong>Reboot Apache2<\/strong> to pick up the new CRL.pem, we must do this since we are using the <strong>SSLCARevocationFile<\/strong> option.\n<pre class=\"lang:default decode:true\">service apache2 restart<\/pre>\n<\/li>\n<li><strong>Browse back<\/strong> to the http:\/\/web-server page<br \/>\n<a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Certificate-Revoked.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3319\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Certificate-Revoked-300x215.jpg\" alt=\"\" width=\"600\" height=\"430\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Certificate-Revoked-300x215.jpg 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Certificate-Revoked-768x549.jpg 768w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-Certificate-Revoked.jpg 903w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><br \/>\n<strong>Sweet! We have been rejected<\/strong> because our client2 certificate has been revoked.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h6>Publicizing Certificate Revocation Information:<\/h6>\n<p>There are two main distribution methods used when publicizing Certificate Revocation information.<strong> CRL Distribution Points(CDP<\/strong>) and <strong>Online Certificate Status Protocol(OCSP)<\/strong>. Both are used to accomplish\u00a0the same thing and allow each party to check the revocation of the other&#8217;s certificate. Both however work in completely different ways and are used\/enforced differently depending on the application using them.<\/p>\n<ul>\n<li><strong>Certificate Revocation List(CRL) Distribution Point (CDP)<\/strong> relies on the x.509 extension <strong>crlDistirbutionPoint<\/strong>\u00a0to be embedded into the certificate. CDPs\u00a0use this <strong>crlDistirbutionPoint<\/strong>\u00a0value as a target to query against asking for a CRL. Very simlilar to our local CRL above. The enforcement and checking of this x.509 extension is the applications responsibility, the application has to look for and check the target location for a CRL and act accordingly. All of these things must add up to accomplish the desired functionality of Certificate Revocation checking. Because of all these varilables that must be performed and exectued witout issues, many applications consider CDP optional, and in most cases if the CDP cannot be contacted, mark the certificate as valid!! I believe Internet Explorer is the only browser I could find that you could enforce CDP checking, and the inability to contact the CDP marks the certificate as untrusted. Both Chrome and Firefox <strong>did not<\/strong> even check with the CDP, and continued on in marking the certificate as valid\n<ul>\n<li><strong>Let&#8217;s take a look at a CDP extension a well known server, like google.com<\/strong>\n<pre class=\"EnlighterJSRAW\" title=\"Checking Google's CRL\" data-enlighter-language=\"generic\">openssl s_client -connect google.com:443 | openssl x509 -noout -text<\/pre>\n<p>Look for this section:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">            X509v3 CRL Distribution Points: \r\n\r\n                Full Name:\r\n                  URI:http:\/\/pki.google.com\/GIAG2.crl\r\n<\/pre>\n<p>We see the section is marked as X509v3 CRL Distribution Points&#8230;CDP!! Within the secion is the target to download the CRL file.<br \/>\nDownload the CRL and view it with openssl<\/li>\n<\/ul>\n<ul>\n<li>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wget http:\/\/pki.google.com\/GIAG2.crl\r\nopenssl crl -inform DER -in GIAG2.crl -noout -text\r\nCertificate Revocation List (CRL):\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Version 2 (0x1)\r\n\u00a0\u00a0\u00a0 Signature Algorithm: sha1WithRSAEncryption\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Issuer: \/C=US\/O=Google Inc\/CN=Google Internet Authority G2\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Last Update: Jan 15 01:00:03 2016 GMT\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Next Update: Jan 25 01:00:03 2016 GMT\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CRL extensions:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 Authority Key Identifier: \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 keyid:4A:DD:06:16:1B:BC:F6:68:B5:76:F5:81:B6:BB:62:1A:BA:5A:81:2F\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 CRL Number: \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 990\r\nRevoked Certificates:\r\n\u00a0\u00a0\u00a0 Serial Number: 377AE3B09D40E542\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Revocation Date: Oct\u00a0 2 10:23:22 2015 GMT\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CRL entry extensions:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X509v3 CRL Reason Code: \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Key Compromise<\/pre>\n<p>As we can see there has been a revoked certificate within Google&#8217;s CRL with<strong> Serial Number: 377AE3B09D40E542. <\/strong>Pret<strong>ty neat!<\/strong><\/li>\n<li>Creating our own CRL and publishing it requires a few steps\n<ul>\n<li>Adding <strong>crlDistributionPoint<\/strong> = URI:http:\/\/ocsp.thejimmahknows.com\/rootCRL.crl\u00a0to our x.509 extension\u00a0<strong>server_req_ext<\/strong>, will add the extension to any new Certificates we sign with our Root Certificate Authority using openssl -config root_openssl.conf -extensions server_req_ext.\n<pre class=\"EnlighterJSRAW\" title=\"openssl.conf\" data-enlighter-language=\"generic\">crlDistributionPoints = URI:http:\/\/ocsp.thejimmahknows.com\/rootCRL.crl\r\n<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>Online Certificate Status Protocol (OCSP)<\/strong> is another way of handling\u00a0automatic Certificate Revocation. The main difference between CDP\u00a0and OCSP is the way they perform both the accounting and client connections to query for revoked certificates. OCSP is protocol based and is simliar to HTTP in that it relies on requests\/response\u00a0method, similarly to many\u00a0tcp service. A difference in accounting, OCSP will actually query the index.db file for the R\/V flags rather than downloading a CRL from a distribution point. Another thing to keep in mind is compatibility as OCSP is not supported in all web browsers. <a href=\"https:\/\/www.fir3net.com\/Security\/Concepts-and-Terminology\/certificate-revocation.html\" target=\"_blank\" rel=\"noopener noreferrer\">Ricky Donato over at fir3net.com has a great write up and outline of the differences between CRL and OCSP, I suggest a read<\/a>. And to his point I had to manually enable OCSP in Firefox, and even then there was compatablity issues. Here are some screenshots in getting OCSP enabled in Firefox:<br \/>\n<a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-About-Config.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3320\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-About-Config-300x134.jpg\" alt=\"\" width=\"600\" height=\"268\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-About-Config-300x134.jpg 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-About-Config-1024x457.jpg 1024w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-About-Config-768x343.jpg 768w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-About-Config.jpg 1199w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPDefaults.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3322\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPDefaults-300x69.jpg\" alt=\"\" width=\"600\" height=\"138\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPDefaults-300x69.jpg 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPDefaults-1024x236.jpg 1024w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPDefaults-768x177.jpg 768w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPDefaults.jpg 1199w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><a href=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPEnable.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3321\" src=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPEnable-300x86.jpg\" alt=\"\" width=\"600\" height=\"172\" srcset=\"https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPEnable-300x86.jpg 300w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPEnable-1024x293.jpg 1024w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPEnable-768x220.jpg 768w, https:\/\/infotechguy.net\/wp-content\/uploads\/2021\/03\/Firefox-OCSPEnable.jpg 1199w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<ul>\n<li>Adding <strong>authorityInfoAccess <\/strong>= OCSP;URI:http:\/\/ocsp.thejimmahknows.com:8080 to our x.509 extensions, <strong>server_req_ext<\/strong>, will add the extension to any new Certificates we sign with our Root Certificate Authority using openssl -config rootca-openssl.conf -extensions server_req_ext.\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">authorityInfoAccess                     = OCSP;URI:http:\/\/ocsp.thejimmahknows.com:8080<\/pre>\n<\/li>\n<li><strong>OCSP Responder<\/strong> is the service that listens to OCSP requests coming in from clients.\n<ul>\n<li>Start it up\n<pre class=\"EnlighterJSRAW\" title=\"OCSP Responder Start up\" data-enlighter-language=\"generic\">openssl ocsp -index index.db -port 8080 -rsigner ocsp.crt -rkey ocsp.key -CA rootCA.crt -text -out \/opt\/log.txt<\/pre>\n<\/li>\n<li>Check against it\n<pre class=\"EnlighterJSRAW\" title=\"OCSP Responder Revoked\" data-enlighter-language=\"generic\">openssl ocsp -issuer rootCA.crt -CAfile rootCA.crt -cert web-server.crt  -url http:\/\/ocsp.thejimmahknows.com:8080\r\nResponse verify OK\r\nweb-server.crt: revoked\r\n\tThis Update: Jan 15 20:15:55 2016 GMT\r\n\tReason: superseded\r\n\tRevocation Time: Jan 15 20:08:22 2016 GMT\r\n<\/pre>\n<pre class=\"EnlighterJSRAW\" title=\"OCSP Responder OK\" data-enlighter-language=\"generic\">openssl ocsp -issuer rootCA.crt -CAfile rootCA.crt -cert web-server2.crt  -url http:\/\/ocsp.thejimmahknows.com:8080\r\nResponse verify OK\r\nweb-server2.crt: good\r\n\tThis Update: Jan 15 20:16:26 2016 GMT\r\n<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>Again this works in theory, however I was unable to get it to function properly\u00a0with Firefox, even when enabling the OCSP config flags shown above. I continued to recieve and error message on the OCSP responded of &#8220;malformed request&#8221;. If any expters out there reading this arctile figure out a way to get OCSP working with Firefox, let me know n the comments please!<\/li>\n<\/ul>\n<\/li>\n<li><strong>In summary,<\/strong> Automatic publication of revocation lists should work in theory, but there so many unknown variables that it tends to fall short. Does the client application support CDP or OCSP or neither? Will the client application <strong>enforce <\/strong>revoked certificates found via CDP or OCSP? What is the default behvior of an application that cannot reach either the CDP or OCSP? <a href=\"https:\/\/www.trustwave.com\/Resources\/SpiderLabs-Blog\/Defective-By-Design----Certificate-Revocation-Behavior-In-Modern-Browsers\/\">Turstwave has a tremendous write up going into more detail regarding CDP, OCSP, and EV.<\/a> Both CRL and OCSP use a signed Certificate file from the Certificate Authority to prove their validity to the client as a revocation entity.<\/li>\n<\/ul>\n<h3>Concept review and thoughts&#8230;<\/h3>\n<ul>\n<li><strong>SSL authentication<\/strong> is very powerful and versatile. We can verify the authenticity of a communication between two parties by issuing Certificates from a Trusted Certificate Authority. Whether that authority is publically known, such as GoDaddy, VeriSign, or Symantec, or a private Certificate Authority we set up using openssl.<\/li>\n<li><strong>Private CA<\/strong>: When setting up a private Certificate Authority using openssl, I would suggest thinking about who out of this relationship you want to manage and be the authoritative entity. Making the decisions on signing certificates as\u00a0 trusted and in good standing.\n<ul>\n<li>Keep in mind when deciding who will be the Private Certificate Authority in this relationship and the concept of CRLs. Remember CRLs are published by the Certificate Authority, so\u00a0understand that the Certificate Authority makes revocation decisions.<\/li>\n<\/ul>\n<\/li>\n<li><strong>2-Level CA<\/strong>: In a real world environment your Root Certificate Authority would be offline, meaning kept on a system that is not turned on. Root Certificate Authority&#8217;s certificates are usually in the span of 10-20 years.\u00a0Hence the need for a subordinate root Certificate Authority with a shorter validity period that would perform actual signing of end-user certificates, such as our web-server, etc. This is commonly referred to as a <strong>2-level<\/strong> Certificate Authority.<\/li>\n<li><strong>Trusting Public CA&#8217;s,<\/strong> if both parties of a communication use and trust Public CA&#8217;s, such as Godaddy or Verisign, then the client and server of a 2-way SSL handshake will be considered trusted and authenticate successfully.\n<ul>\n<li>With the above being true, consider an additional form of authentication before authorizing.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Authority Info Access(AIA)<\/strong> is an x.509 extension that provide\\s details about how to access information regarding revocation extensions\u00a0Certificate Authority.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>Helpful links:<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.trustwave.com\/Resources\/SpiderLabs-Blog\/Defective-By-Design----Certificate-Revocation-Behavior-In-Modern-Browsers\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.trustwave.com\/Resources\/SpiderLabs-Blog\/Defective-By-Design&#8212;-Certificate-Revocation-Behavior-In-Modern-Browsers\/<\/a><\/li>\n<li><a href=\"http:\/\/isrlabs.net\/wordpress\/?p=169\" target=\"_blank\" rel=\"noopener noreferrer\">isrlabs.net\/wordpress\/?p=169<\/a><\/li>\n<li><a href=\"http:\/\/withagrainofsalt.co.uk\/2013\/07\/21\/creating-a-ca-using-openssl-with-ocsp\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/withagrainofsalt.co.uk\/2013\/07\/21\/creating-a-ca-using-openssl-with-ocsp\/<\/a><\/li>\n<li><a href=\"http:\/\/security.stackexchange.com\/questions\/86907\/is-there-any-use-in-an-aia-extension-in-a-certificate-directly-issued-by-a-root\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/security.stackexchange.com\/questions\/86907\/is-there-any-use-in-an-aia-extension-in-a-certificate-directly-issued-by-a-root<\/a><\/li>\n<li><a href=\"https:\/\/blog.hqcodeshop.fi\/archives\/145-Certificate-Authority-setup-Doing-it-right-with-OpenSSL.html\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/blog.hqcodeshop.fi\/archives\/145-Certificate-Authority-setup-Doing-it-right-with-OpenSSL.html<\/a><\/li>\n<li><a href=\"http:\/\/pki-tutorial.readthedocs.org\/en\/latest\/expert\/root-ca.conf.html\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/pki-tutorial.readthedocs.org\/en\/latest\/expert\/root-ca.conf.html<\/a><\/li>\n<li><a href=\"http:\/\/www.mad-hacking.net\/documentation\/linux\/security\/ssl-tls\/creating-ca.xml\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.mad-hacking.net\/documentation\/linux\/security\/ssl-tls\/creating-ca.xml<\/a><\/li>\n<li><a href=\"http:\/\/jpmens.net\/2009\/04\/29\/openssl-issuing-distribution-point-idp-in-crl\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/jpmens.net\/2009\/04\/29\/openssl-issuing-distribution-point-idp-in-crl\/<\/a><\/li>\n<li><a href=\"https:\/\/scotthelme.co.uk\/certificate-revocation-google-chrome\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/scotthelme.co.uk\/certificate-revocation-google-chrome\/<\/a><\/li>\n<li><a href=\"http:\/\/pki-tutorial.readthedocs.org\/en\/latest\/expert\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/pki-tutorial.readthedocs.org\/en\/latest\/expert\/<\/a><\/li>\n<li><a href=\"http:\/\/www.securesenses.net\/2013\/05\/x509-certificates-critical-vs-non.html\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.securesenses.net\/2013\/05\/x509-certificates-critical-vs-non.html<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Table of Contents About SSL Authentication Quick Review Creating a Certificate Authority 1-way &#8220;Standard&#8221; SSL Authentication 2-way &#8220;Mutual&#8221; SSL Authentication Advanced SSL Authentication: CRLs, CDP, and OCSP Concept Review About SSL Authentication: TLS Authentication or&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":4240,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[112],"class_list":["post-2531","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-security-2"],"_links":{"self":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts\/2531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2531"}],"version-history":[{"count":6,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts\/2531\/revisions"}],"predecessor-version":[{"id":4246,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts\/2531\/revisions\/4246"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/media\/4240"}],"wp:attachment":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}