Perform a GET OCSP request in (almost) one line

First, it is required to define the following function:

$ urlencode () 
> { 
>     python -c "import urllib; print urllib.quote('''$1''', '')"
> }

Then the OCSP request can be performed like this:

$ curl http://ocsp.example.org/$(urlencode `openssl ocsp -issuer issuer.pem -cert end_entity.pem -reqout - | base64 -w 0`) | openssl ocsp -respin - -text -CAfile rootca.pem
...
OCSP Response Data:
    OCSP Response Status: successful (0x0)
    Response Type: Basic OCSP Response
    Version: 1 (0x0)
    Responder Id: 98D1F86E10EBCF9BEC609F18901BA0EB7D09FD2B
    Produced At: Nov 11 14:16:01 2019 GMT
...

Leave a Reply

Your email address will not be published. Required fields are marked *

WP2Social Auto Publish Powered By : XYZScripts.com