-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Go Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Context
I'm running a local server for local development and an Atlas serverless instance for testing in the cloud (GCP Cloud Run container instance). In the cloud instance the connection certificate is not accepted by my container, probably because the container lacks root CA certs, but I've not investigated, that's not the issue.
To make Cloud Run container work I've added
SetTLSConfig(&tls.Config{InsecureSkipVerify: true{color}})
option for the client initiation, to ignore certificate issues. In early development this is acceptable.
However, when I then tried to connect to my local instance - I encountered an odd failure.
My local instance is a replica set, and my connection string is:
mongodb://localhost:54512/?directConnection=true&serverSelectionTimeoutMS=2000
Using Compass I can connect no problem, but my system bootstrap fails with the following error:
```
failed to create executor: failed to bootstrap system dependencies: failed to bootstrap system dependencies: failed to create MongoDB client: failed to connect to MongoDB: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: localhost:54512, Type: Unknown, Last error: EOF }, ] }
```
If I remove the `SetTLSConfig` option, all other things being equal - everything works just fine. Putting it back in - fails my connection again.
It seems that calling `SetTLSConfig()` affects some other options, however, it shouldn't since I've not set any other values in the config apart from the `InsecureSkipVerify` flag.
Definition of done
`InsecureSkipVerify` should not affect other parameters of the connection.
Environment
- go.mongodb.org/mongo-driver v1.17.1
- MongoDB Compass: Version 1.44.6
- Local DB: MongoDB 8.0.3 AtlasLocalDev
- MacOS Sonoma 14.6.1 (23G93) MBP M1
- is caused by
-
GODRIVER-3361 Improve error message when connection is closed by the OS
-
- In Progress
-