-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Describe the problem
Based on my reading of postgres jdbc documentation, a user should be able to specify a PKCS-12
formatted key in the sslkey
url parameter. When providing a key in this format, they are not required to provide the sslcert
parameter as the PKCS-12
format includes both the key and the cert in a single file. Or at least that is how i interpreted this line in their documentation... Note: This parameter is ignored when using PKCS-12 keys, since in that case the certificate is also retrieved from the same keyfile.
. If i attempt to send a url to cockroach sql
that includes the sslkey
parameter but not the sslcert
parameter I am presented with this error...
ERROR: invalid argument "postgresql://localhost:26257/spring_examples?ApplicationName=datasource&reWriteBatchedInserts=true&sslmode=verify-full&sslrootcert=/Users/timveil/Documents/GitHub/spring-examples/docker/lb-haproxy-secure/ca.crt&sslpassword=password&sslkey=/Users/timveil/Documents/GitHub/spring-examples/docker/lb-haproxy-secure/client.pfx" for "--url" flag: URL validation error: sslcert
Client certificate missing.
Failed running "sql"
To Reproduce
I use this repo to create a secure 3 node cluster (https://github.com/timveil-cockroach/spring-examples/tree/master/docker/lb-haproxy-secure)
I use the client key and cert generated from the cockroach cert
command and stored in the shared volume to create a PK12 file (client.pfx
).
I then pass what should be a valid url to local instance of the cockroach sql client and get the above error. Here is the exact command i pass.
cockroach sql --url='postgresql://localhost:26257/spring_examples?ApplicationName=datasource&reWriteBatchedInserts=true&sslmode=verify-full&sslrootcert=/Users/timveil/Documents/GitHub/spring-examples/docker/lb-haproxy-secure/ca.crt&sslpassword=password&sslkey=/Users/timveil/Documents/GitHub/spring-examples/docker/lb-haproxy-secure/client.pfx'
Expected behavior
I expect to get farther than the url validation error above.
Additional data / screenshots
Additional context
Jira issue: CRDB-12498