I am unable to connect to a Mongo db which is hosted in IBM cloud. I have got the credentials and the db name. I am using direct authentication method but getting sometime timeout error or sometime "Client network socket disconnected before secure TLS connection was established" error. I am new to Mongo client. It seems ibm cloud team do not set any restrictions and on public internet. I can do a telnet with the server string.
1.Do I need to use any configuration in Mongo compass client like installing certificates?
2.Do I need to request for ip binding (though my ip is dynamic)
Any help will be appreciated on this
Related
When trying to connect to AWS DocumentDB using mongocxx C++ driver, even after using the AWS combined pem file as a URI parameter (CA file), I get the below error of TLS handshake failed.
No suitable servers found (`serverSelectionTryOnce` set): [TLS handshake failed: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed calling ismaster on 'docdb-xxxxxxxx.ap-southeast-1.docdb.amazonaws.com:27017']: generic server error
I have masked out the full hostname of the documentdb instance. I am using the connection URI method mentioned in http://mongocxx.org/mongocxx-v3/configuration/
// 2) Using the URI
auto client2 = mongocxx::client{uri{"mongodb://host1/?tls=true&tlsAllowInvalidCertificates=true&tlsCAFile=/path/to/custom/cert.pem"}};
I am using mongocxx 3.4.2 and libmongoc 1.16.2
I have tried this connection with the Node.js driver and it is able to connection. Any ideas what could be wrong?
I was trying to connect to my DocumentDB cluster on AWS via an external app like TablePlus and I had the same error:
No suitable servers found
(`serverSelectionTryOnce` set): [Failed to resolve 'docdb-1984-08-10-12-14-15.cluster-boogeyman.xy-central-99.docdb.amazonaws.com']
What I tried next is to:
open all sort of incoming traffic in the security group assigned to my cluster
made sure that "Encryption-at-rest" (in Advanced Settings) is disabled while creating the cluster
I still got this error. What I discovered next is that:
Trying to connect to an Amazon DocumentDB cluster directly from a public endpoint, such as your laptop or local development machine, will fail. Amazon DocumentDB is virtual private cloud (VPC)-only and does not currently support public endpoints. Thus, you can't connect directly to your Amazon DocumentDB cluster from your laptop or local development environment outside of your VPC.
Please read the AWS connection troubleshooting section. To connect to an Amazon DocumentDB cluster from outside an Amazon VPC, you can use an SSH tunnel.
Our dev ops team have whitelisted my home ip address so that I can connect to our Postgres database on Azure. I am able to connect to our Azure database due to this.
Today I set up a VM in order to run Docker. I am running a container for RStudio which is an app that, among many other things, allows me to connect to our database using ODBC.
After configuring the odbcinst and odbc.ini files I believe that those are configured correctly because when I try to connect I get the following error:
Error: nanodbc/nanodbc.cpp:983: 00000: FATAL: SSL connection is required. Please specify SSL options and retry.
Thus I think that my odbc set up is correct because this error suggests my connection setting are fine, it's just that Azure will not allow it without SSL.
Searching that error message took me to this SO post with the following accepted answer:
By default, Azure Database for PostgreSQL enforces SSL connections between your server and your client applications to protect against MITM (man in the middle) attacks. This is done to make the connection to your server as secure as possible.
Although not recommended, you have the option to disable requiring SSL for connecting to your server if your client application does not support SSL connectivity. Please check How to Configure SSL Connectivity for your Postgres server in Azure for more details. You can disable requiring SSL connections from either the portal or using CLI. Note that Azure does not recommend disabling requiring SSL connections when connecting to your server.
My question is, if I am already able to connect to our database outside of my VM due to my home IP being whitelisted and just using a Postgres Driver with Dbeaver SQL client, is there anything I can do to connect from within my VM?
I can get my VMs ip address but I suspect (am not sure) if sending hat to our developers to whitelist would work?
Is there a prescribed course of action here?
I added this parameter to my .odbc.ini file and was able to connect:
sslmode=require
From Azure Postgres documentation, this parameter may take on different permutations depending on the context
"for example "ssl=true" or "sslmode=require" or "sslmode=required" and other variations"
I have created a CloudSQL instance which was part of a VPC I have created.
I'm able to connect to this CloudSQL using CloudSQL Proxy service. But I'm unable to connect to this instance using public IP of the instance though I added the firewall rule to this VPC.
The error I'm getting:
Unable to connect to host <public-ip-of-cloudsql>, or the request timed out.
Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).
MySQL said:
Can't connect to MySQL server on '<public-ip-of-cloudsql>' (4)
Following is the firewall rule I added and provided my home IP address in the blocked out area.
Please let me know if I'm missing something. I can provide more details if needed.
These are the steps you should follow in order to connect to Cloud SQL using the public IP:
Created a Cloud SQL instance, including configuring the default user.
Assuming you use a local client:
2.Install the client.
3.Configure access to your Cloud SQL instance.
4.Connect to your Cloud SQL instance.
You can find a detailed explanation here: Connecting MySQL client using public IP
If you are using the Cloud SQL proxy to connect via public ip, it requires port 3307 to be open to the address.
If you aren't using the Cloud SQL proxy to connect via public ip, you need to authorize your external IP.
I was able to connect CloudSQL which is part of a VPC by just adding the client IP address as Authorized networks.
It's weird, I tried many times before but couldn't succeed. It is working now.
Thanks, guys for answers.
I have configured Bluemix Secure gateway client to connect to DB2 on AS 400 using a Windows machine. I am able to run the Db2 connection successfully from the application on Windows machine where Secure gateway client is running. But when I run the same application on Bluemix with modifying the code to depict Secure Gateway client destination details, I get 'Connection Refused' error.
I had gone through how to connect a bluemix app to on-premise db/as400? , which mentions about Secure gateway client for OS 400.
Wanted to understand how to fix the issue for 'Connection Refused' ? Do we have to use different DB2Driver/ DB2 Connect string from Bluemix? or Any other settings to be done on AS400 server?
Given that the Connection refused error is occurring between your BlueMix application and the SG Servers and no logs are being generated on the SG Client, it sounds like the issue is with a listener not being opened on the SG Servers rather than an issue between the SG Client and DB2. All listeners should come up when the SG Client initially connects to the SG Servers.
Are you able to cURL or telnet the cloud host:port provided with this particular destination? Or is this connection refusal specific to your BlueMix app? In either case, this answer will provide more direction on where to investigate further.
I am trying to connect Mongolab URI from my mongo shell and its showing
MongoDB shell version: 3.1.7
connecting to: ds015859.mlab.com:15859/instabuy
2016-03-16T16:49:15.581+0530 W NETWORK [thread1]
Failed to connect to 54.224.218.3:15859, reason: errno:10061
No connection could be made because the target machine actively refused
2016-03-16T16:49:15.581+0530 E QUERY [thread1] Error: couldn't connect to server ds015859.mlab.com:15859, connection attempt failed :
connect#src/mongo/shell/mongo.js:216:14
I am behind a http web proxy in my college, but I already set my HTTP_PROXY variable. I already connected to heroku by setting the proxy variable also. But other services like Mongolab, Mailchimp and AWS s3 are refusing connection..what should I do, Please help.
Different services such as MongoDb and others use custom command protocols to communicate with clients. For, example, in MongoDb they use binary MongoDB Wire Protocol. A HTTP proxy can handle only a limited set of protocols, most proxies are configured to proxy the HTTP text protocol only. So, you can't connect to mongo server via such proxy unless you have a HTTP-wrapper around the mongo protocol.
If you want to connect remotely to any service with any protocol indirectly via something like a proxy then you have to use tunneling. Tunnels can work at the IP:port level (SSH tunnels, as an example) or be established over VPN (OpenVPN tunnels, for example). In both cases you first establish a tunnel with your "proxy" server and then redirect mongo connection to that tunnel.