 <p>I'm not sure why you are trying to get that string since to my knowledge most ssl functions will take the whole cert to verify. </p> <p>Have you seen <a href="http://stackoverflow.com/a/27251088/4474526">this post</a>? It looks like what you want.</p> <p>Hope that helps.</p> <p>EDIT:</p> <p>I <a href="https://www.v13.gr/blog/?p=303" rel="nofollow">think</a> this example will help you understand what's every argument and in what format should it be. </p>