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

Certificate verification error when trying to connect to collection. #227

Open
TWilliams2441 opened this issue Oct 2, 2021 · 6 comments

Comments

@TWilliams2441
Copy link

TWilliams2441 commented Oct 2, 2021

I'm getting an error when attempting to connect to a MongoDB collection using mongo() on Windows 10. I'm not having the same issue in debian based docker containers.

Error: No suitable servers found ('serverSelectionTryOnce' set): [TLS handshake failed: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed calling ismaster

The issue can be temporarily rectified using mongo(..., options = ssl_options(weak_cert_validation = TRUE))

Is this a mongolite problem, windows problem, MongoDB problem, or a combination?

I've attempted to remove and reload the ISRG X1 certificate.

@jeroen
Copy link
Owner

jeroen commented Oct 4, 2021

Maybe this is related to the expired lets encrypt root cert? https://letsencrypt.org/2021/10/01/cert-chaining-help.html
The problem will probably be resolved when the server renews the cert?

@geneorama
Copy link

possible duplicate of #219

I'm having the same issue using Windows 10 with Mongo Atlas. I know it's something that mongolite is doing because the Python connection works with no problem.

The Python connection isn't the same though. All the mongolite connections are connecting to a thing in the database like mtcars, rather than just connecting to the server, for example: m <- mongo("mtcars", url = "mongodb://readwrite:[email protected]:43942/jeroen_test") I'm not sure if mtcars is a database or collection or project, or if jeroen_test is the database / collection / project.

So it's harder to troubleshoot the connection because it's trying to do two things, I think.

@jeroen
Copy link
Owner

jeroen commented Nov 9, 2021

@geneorama did you first get this problem today? I just did a patch release on cran earlier today because yesterday's release 2.4.0 had a bug. Can you make sure you're on the latest mongolite 2.4.1?

@geneorama
Copy link

I was on 2.3.1 from CRAN, and I had run update.packages('mongolite')

Mongo support suggested adding ?tls=true&retryWrites=true&w=majority to the connection string, which didn't work in 2.3.1.

I'm in the process of downloading the latest version, and I'll try again. Thanks!

@geneorama
Copy link

Upgrading to 2.4.1 solved the issue for me, and the TLS part of the string didn't matter. Thanks. I don't know if my issue was the same as this issue, but it appeared to be the same as this one and #219.

Also I can connect using just the URL and not specifying a database.

Thanks again

@npechl
Copy link

npechl commented Aug 1, 2024

Hi,

I am trying to run the example for connecting to demo server

library(mongolite) m <- mongo("mtcars", url = "mongodb://readwrite:[email protected]:43942/jeroen_test")

but I am getting the following error:

Error: No suitable servers found (`serverSelectionTryOnce` set): [Failed to resolve 'mongo.opencpu.org']

Any suggestion please?

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

4 participants