cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting to postgres Cloud DB with SSL enabled

SOLVED
Highlighted
New Contributor

Connecting to postgres Cloud DB with SSL enabled

Hello All

 

I am planning to store my test results in postgres Cloud DB. Cloud DB accepts connection only with SSL enabled. 

 

I have tried below configuration . Same configuration works fine with plain java program but not with groovy.

 

Any suggestions ?

 

Map batchDBConnParams = [
ssl: 'true',
sslmode: 'verify-ca',
sslrootcert: 'D:\\venkat\\automation\\postgres\\pg_badge.cert',
user:'XXXXXX',
password:'XXXXX',
url:'jdbc:postgresql://cloudURL:32681/DB_name',
driver: 'org.postgresql.Driver',
sslfactory:'org.postgresql.ssl.NonValidatingFactory'  // This i have added based on some other topic suggestion .
]

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Connecting to postgres Cloud DB with SSL enabled

If that is the case, then open a ticket SmartBear customer care.
Mean while use previous version which is working for you.



Regards,
Rao.

View solution in original post

3 REPLIES 3
Community Manager

Re: Connecting to postgres Cloud DB with SSL enabled

Any idea what could be going on here ?

 

@HimanshuTayal @richie @msiadak @nmrao 


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
New Contributor

Re: Connecting to postgres Cloud DB with SSL enabled

Everything is working fine in java program . but not on readyapi.

 

Please find the full code below .. I was seeing in some other post that it was working in previous version and not in 3.2.0 version.

 

import groovy.sql.*
import com.eviware.soapui.impl.wsdl.support.wss.crypto.CryptoType
import com.eviware.soapui.settings.SSLSettings
import com.eviware.soapui.SoapUI


def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)

com.eviware.soapui.support.GroovyUtils.registerJdbcDriver( driver )


def keystorePath = "D:\\XX\\XX\\XX\\cert\\ibm_cloud_db.jks"

// set
SoapUI.settings.setString( SSLSettings.KEYSTORE, keystorePath )
SoapUI.settings.setString( SSLSettings.KEYSTORE_PASSWORD, "XXXXX!" )

// get
log.info (SoapUI.settings.getString( SSLSettings.KEYSTORE, "value to return if there is no such setting set" ))

 

Map batchDBConnParams = [
ssl: 'true',
sslmode: 'verify-full',
user:'XXXXX',
password:'XXX',
url:'jdbc:postgresql://XXXXXX:32681/XXXX',
driver: 'org.postgresql.Driver'
]


// Connect to the SQL instance.
//def conn = Sql.newInstance(url, user, password, driver)
def dbConnection = Sql.newInstance(batchDBConnParams);

Highlighted
Community Hero

Re: Connecting to postgres Cloud DB with SSL enabled

If that is the case, then open a ticket SmartBear customer care.
Mean while use previous version which is working for you.



Regards,
Rao.

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors