How does sslmode=prefer even works if https://godoc.org/github.com/lib/pq doesn't support

Context: I am working on https://github.com/sorintlab/stolon/pull/644 and trying to issue checkpoint using pq/sql (Go) package instead of using psql.

However, the challenge that I am facing is its hardcoded as mode prefer and when I try to run tests it fails. I am missing something. Can someone advise?

@viggy28 I’m not sure I understand the issue and why tests fails. Can you provide more details (code, outputs etc…)?

Thanks @sgotti for the response.

Sure, here is the patch for the PR github gist

Specifically, if I don’t do disable ssl mode, then the test fails with error pg: unsupported ssmlmode “prefer”;