Programmatically verify certificate chain using OpenSSL API

You can use the normal validation routines (see How do you verify a public key was issued by your private CA?), like the -verify function in OpenSSL does. You need to create a lookup method (X509_LOOKUP_METHOD) like X509_LOOKUP_file(), but which works with a character string instead of a filename. The code for X509_LOOKUP_buffer() is as … Read more

Error in JavaMail : PKIX path building failed unable to find valid certification path to requested target

Ok problem solved! The solution is this: First get the self-signed certificate from the mail server via openssl: echo | openssl s_client -connect yoursever:port 2>&1 | sed -ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p’ > yourcert.pem Then save the yourcert.pem file into this path /Library/Java/Home/lib/security (on macOSX) and put the cert file into the cacerts like this keytool … Read more

Invalid self signed SSL cert – “Subject Alternative Name Missing”

To fix this, you need to supply an extra parameter to openssl when you’re creating the cert, basically -sha256 -extfile v3.ext where v3.ext is a file like so, with %%DOMAIN%% replaced with the same name you use as your Common Name. More info here and over here. Note that typically you’d set the Common Name … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)