Where can I manage TLS settings on GCloud? - sql-server

I have a server (A) hosted on GCloud VM instance which points to an SQL database (B) also hosted on GCloud. Within the program on server A there is a JDBC connector used to access and edit info on server B. Recently after restarting server A, the connector records the following error:
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]".
The SQL instance (B) is set to 'allow unsecure connections'.
If anyone could help me solve this error message I will appreciate it greatly.
I am very new to all of these things, so it would be great if you could be very descriptive with any responses.

Related

AWS RDS Instance is not connecting to Jmeter

I am trying to connect my RDS instance to a Jmeter load test however no matter what I try, I keep getting this error message in the Results Tree:
Cannot create PoolableConnectionFactory (The connection to the host database-1.cqdkrfikhe1t.us-east-1.rds.amazonaws.com, named instance database-1 failed. Error: "java.net.SocketTimeoutException: Receive timed out". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434. For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host.)
I feel it may be a problem with my Database URL in JDBC Connection Configuration.
The picture below shows the summary report.
I have mainly tried rewriting the Database URL multiple different ways but none of them seem to work. I have also tried removing and reinstalling the JDBC Drivers but that doesn't seem to work either. I have absolutely no idea what the problem could be. Could someone please help me out with this problem?
Edit: When I change the Database URL I sometimes get this error
message as well:
Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets
Layer (SSL) encryption. Error: "PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target".
ClientConnectionId:9b700d73-f3f0-4cf6-b3a4-607fa9827219)
I think you need to use port 1433
Check out Connecting to a DB instance running the Microsoft SQL Server database engine article
So cross check the port number, VPC options, public accessibility, etc. with the values from the JDBC Connection Configuration
More information: The Real Secret to Building a Database Test Plan With JMeter

Azure app service with hybrid connection can't access on prem SQL Server

I have an app service with hybrid connection enabled(on a VM in the same network with the SQL Sever) for me to access on prem SQL Server, which I don't own. However, the connectivity has been pretty unstable.
I am able to access to the SQL Server probably for maybe 5% of the tries and mostly I just get error
One or more errors occurred. (A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.
I'm able to log in thru SSMS on the VM. Connection string should be alright since I can access locally(local network is the same network as the SQL Server).
Named instances use dynamic ports and UDP, which are not supported by Hybrid Connections. Suggest you using static port as Nick mentioned. Please refer to this document Connect to on-premises SQL Server from a web app in Azure App Service using Hybrid Connections to get more information.
provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.
What is your Windows version? When Windows versions that don't contain the leading zero fixes for TLS_DHE will display this error message. You can try to update windows version or disable the TLS_DHE ciphers to solve this issue. Please refer to this document.

Throwing this error message "Error -1 - SQL connection failed." when trying to connect SQL server from Microsoft Azure's Database Migration Services

We tried to do one poc which meets our upcoming requirement in my personal Laptop. The requirement is migrating the on premise sql database into azure sql database.
The screen shot of error is,
Connection error message and description
Below are steps which we have done.
Step1:
We have created a sql database in azure portal. The server name is like sundar64599.database.windows.net
The Screenshot is here, Sql database in azure poral
Stpe2:
Then We have done the assessments and created the migration project in Data Migration Assistant tool and we deployed it successfully.
Step 3:
Then we created a Database Migration Services and tried to create a migration project.
Here we entered the source server details to connect and it throws the error as mentioned added the screenshot above.
And also we tried the below to resolve this connect issue.
1. In sql server confuguration management,
a. We restarted the sql server and tried to connect. But it fails. The screenshot is Sql server restart
b. Then we had set the TCP port as 1433 and dynamic port as 50313 and tried to connect. But it fails. The Screenshot is, Tcp with dynamic port
c. Then we had set the TCP port as 1433 and dynamic port as empty and tried to connect. But it fails. The screenshot is, Tcp empty dynamic port
2. In Sql database of azure portal, we checked the client ip and added the exact ip and tried. Even it fails. The Screenshot is, Firewall ip settings
Please add your suggestions to resolve this connection issue.
Thanks in advance,
Samidurai Tamilmani
You need to provide the FQDN (Fully Qualified Domain Name) or Public IP of the source server as described here. The way you are providing the source server will work in the local network but not from outside, which is required by the Azure Migration services.
So make sure that your source server is available from the internet. You can have a look at the complete steps here - https://learn.microsoft.com/en-us/azure/dms/tutorial-sql-server-to-azure-sql

SQL remote connection not working on google compute engine

I have a google compute engine with a static IP address running widows server 2012 with SQL server 2012 express.
I have enabled SQL remote connections by following the instructions here and have setup windows firewall and google firewall to allow connections on port 1433. I also verified that SQL engine is running.
I have tested the port connection with telnet and it's allowing the connection.
The problem is that i still am not able to connect to the server.
error:
a network related or instance specific error occurred while
establishing a connection .... error 26 error locating server
specified
Here's the connection string im using
"Data Source=IP Address\SQLEXPRESS;Database=dbname;User Id=xyz;Password=123;"
A user posted the same question here but i am able to telnet my server.
I have used the same steps before with a AWS server and everything worked perfect. Is there other steps that have to be done with a google compute server ?
If you are attempting to connect from a remote machine outside of GCP, then have you looked inside your SQL Server Firewall Rules, under the Advanced tab,the Edge Traversal setting?
Edge Traversal Setting
I had an error in the connection string.
I ended up switching to Amazon AWS servers and the following connection string works.
"Data Source=ec2-00-000-00-000.compute-1.amazonaws.com,PORT#;Database=test;User Id=xyz;Password=1234;"

establish remote connection to a SQL server instance

I am not able to establish remote connections to SQL Server 2008 enterprise edition.
I have followed and implemented a lot of tutorials available. These are the things i have done:
enabled TCP/IP connections in SQL configuration manager.
added a rule to allow inbound connections at port 1433.
allowed remote connections in the properties window of the concerned instance.
But it still gives the error
I am trying to install samples for replication using AdventuresWorks database and i am not able to install the sample.
here is the error i got
Attempting to create the 'ReplData'
share that replication uses as the
working directory.
A subdirectory or file C:\Program
Files\Microsoft SQL
Server\100\Samples\Replica
tion\ReplData already exists. The name
has already been shared.
More help is available by typing NET
HELPMSG 2118.
HResult 0x274D, Level 16, State 1 TCP
Provider: No connection could be made
because the target machine actively re
fused it.
Sqlcmd: Error: Microsoft SQL Server
Native Client 10.0 : A network-related
or in stance-specific error has
occurred while establishing a
connection to SQL Server . Server is
not found or not accessible. Check if
instance name is correct and i f SQL
Server is configured to allow remote
connections. For more information see
SQL Server Books Online.. Sqlcmd:
Error: Microsoft SQL Server Native
Client 10.0 : Login timeout expired.
The publication was created
successfully. You must create a
virtual directory to use Web
synchronization. If you plan to use a
separate Web server, you must run the
Web Synchronization Wizard on that Web
server. (A certificate that supports
SSL must already be installed.)
Do you want to create a virtual
directory named SalesOrders for Web
synchronization on S2NWORKSTATION?
[y,n]
Start the SQL Management Studio
Connect to the server.
Then choose the server in the Object-Explorer and right-click on properties.
Then check the "connections" settings, there you can/have to allow remote connections for this database server.
Are you connecting to a default instance or named instance? If a named instance, then you you should have the sql browser windows service running. Also ensure that remote connections are allowed (I believe this is a different setting than simply turning on TCP/IP).
One tool that could be helpful is PorQryUI (Port Query), it will test to see if the proper ports are open.
I too, had this problem. I solved by doing a couple of things:
1. Make sure the SQL Browser service is started on my local machine
2. Make sure UDP Port 1434 in the firewall is open for outgoing on the local machine
3. Make sure UDP Port 1434 is open in the firewall for incoming on the remote machine.
The UDP Ports are for the SQL Server Browser. Apparently, Visual Studio uses that to detect that the remote server exists.
This Stack Exchange thread was very helpful to me.

Resources