I have a webserver, that I run a small side business on (www.trailmyx.com). Recently I began developing some basic SSL socket code (in C++) and I wrote a small test program that connects with OpenSSl and does an http GET. I can use my client successfully against www.google.com on port 443 (or any other site) except my own.
When I attempt to SSL_get_verify_result(ssl) against my own server, I get back: X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT.
Now, when I go to my web site in a browser (https://www.trailmyx.com) I can examine the cert and everything looks OK... It doesn't show up as self signed.
Similarly, when I use wget against my server I get the same self signed certificate error.
My gut feeling is that somehow my site is misconfigured, but if so, how can the browsers do it? Is their some other sequence of OpenSSL calls the browsers know to make?
Note: When wget against my server returns, it prints some information from the certificate. None of that information is valid (for example: /C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit) I strongly suspect that for some reason, under certain circumstance apache is returning a self signed cert... but why? And how are the browsers doing it? BTW- CURL works just fine.