Unable to connect to database which is ssl enabled

I am unable to connect to MySQL database which is ssl enabled. The robot framework code is given below

Suite Setup Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort}

When I execute, I get this error

Suite setup failed:
OperationalError: (2003, “Can’t connect to MySQL server on ‘cpmdb-nonprod.mysql.database.azure.com’ ([Errno 11001] getaddrinfo failed)”)

Please let me know how I can make my tests pass

1 Like

I have similar issue. Did you find the answer?

*** Settings ***
Library DatabaseLibrary
Library OperatingSystem

Suite Setup Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort}
Suite Teardown Disconnect From Database

*** Variables ***
${DBName} dispatch
${DBUser} user
${DBPass} pass
${DBHost} HostChangedForSecurity.us-east-1.rds.amazonaws.com
${DBPort} 3306

*** Test Cases ***
Check if admin is present in DB
Check If Exists In Database SELECT name FROM dispatch.admin WHERE id=1355

Error I am getting:
OperationalError: (3159, ‘Connections using insecure transport are prohibited while --require_secure_transport=ON.’)

Hi @rabelov and @pinakincytrio,

I’ve not done this myself, but hopefully this will help,

From a quick look at the documentation I think you’ll need to use Connect To Database Using Custom Connection String or Connect To Database Using Custom Params

The documentation for pymysql’s Connection Object shows several ssl related paramaters, so you’ll need to see which ones you need.

Hope that helps,

Dave.