Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using client certs to authenticate #25

Open
grtjn opened this issue Nov 30, 2022 · 3 comments
Open

Using client certs to authenticate #25

grtjn opened this issue Nov 30, 2022 · 3 comments

Comments

@grtjn
Copy link

grtjn commented Nov 30, 2022

I am trying to use DBeaver to setup a connection to an ODBC server. Using a non-ssl-enabled port works fine. Using an ssl-enabled port works fine too, even with verify-ca. Using a client cert to login fails however. I keep getting the message that I am not providing a valid password (which I left blank intentionally). Looking at the code of mljdbc, I wonder if using client certs to authenticate is supported at all. Does anyone know?

https://developer.marklogic.com/code/jdbc/#authentication provides good detail on how to setup an SSL connection to an ODBC app server with SSL enabled, but doesn't go as far as telling whether using client certs to authenticate is possible, and if so, how. I was told by Support however, to have a look here: https://www.postgresql.org/docs/10/libpq-ssl.html#LIBPQ-SSL-CLIENTCERT. That page speaks about sslcert and sslkey properties, which are easily configured in DBeaver, which is showing a nice list of Driver properties to pick from.

PS: the link to https://basildoncoder.com/blog/postgresql-jdbc-client-certificates.html on the mentioned DMC page is dead..

@bobstarbird
Copy link
Collaborator

bobstarbird commented Nov 30, 2022 via email

@bobstarbird
Copy link
Collaborator

bobstarbird commented Nov 30, 2022 via email

@grtjn
Copy link
Author

grtjn commented Dec 1, 2022

Yes, I have all of that.. ssl=true, sslfactory=org.postgresql.ssl.jdbc4.LibPQFactory, sslmode=verify-ca, sslrootcert=ca-bundle.crt, and sslcert and sslkey are pointing to a .crt and .key pair for a MarkLogic user (some svc_datahub user). I am getting 'ERROR: XDMP-INTERNAL: Internal error: Unauthorized user' however.

Looking at the trace log, I see it tries to login with 'josten' (which is my username on my Windows laptop, not the sslcert name), and that it seems to go into the function to attempt user/pwd authentication. That made me look at the code, and I could not see logic to authenticate using sslkey/cert, hence my question if that ought to work or not..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants