I’m connecting to my three roach cluster securely using libpqxx. This works fine from the Linux Subsystem For Windows on my Surface Pro. It works fine from a Debian Stretch machine.
Problem is when I put the code onto a Google cloud instance running Debian Jessie it fails to connect.
This is how I make the connection:
Persist::Persist() {
cout << "Persist::Persist..." << endl;
try {
string uri = ("postgresql://someone@someserver:26257/"
"time_series?password=1234&sslmode=verify-full&"
"sslrootcert=ca.crt");
auto cp = new pqxx::connection(uri);
...
...
} catch (const exception &e) {
cerr << "Persist::Persist: FAIL" << endl;
}
}
This is the error I get on Debian Jessie:
$ ./testFeeder
Persist::Persist...
Persist::Persist: FAIL
server common name "node" does not match host name "someserver"
Segmentation fault
Thinking this may be an issue with our Jessie server I fired up a clean instance of Jessie in VirtualBox, with the same results.
I have no idea where it’s getting that common name “node” from.
Did I create my ca.crt incorrectly?
Do I have a problem with an old openssl version on Jessie (OpenSSL 1.0.1t 3 May 2016) ?
Sorry this is not directly a cockroachdb question but pqxx is what we have to use here.
Any ideas? Anyone?
Edit: Sure enough upgrading that Jessie in VirtualBox to Stretch gets my code working. Problem is we are not about to upgrade our cloud server instances.