cancel
Showing results for 
Search instead for 
Did you mean: 

How to access HDI Container of Cloud Foundry trial account in Python?

former_member184876
Active Participant

Hi Experts,

Need your guidence with below requrement:

Is it possible to access the HDI container of Cloud Foundry "trial" using Python application (example Flask)?

I can do it very easily using Node.js express

But with Python, i am getting issues.

I am trying to access like below:

hana = env.get_service(label='hanatrial')

conn = dbapi.connect(address=hana.credentials['host'], port=int(hana.credentials['port']), user=hana.credentials['user'], password=hana.credentials['password'], encrypt="true")

Error:

========================================

hdbcli.dbapi.Error: (-10709, 'Connection failed (RTE:[300010] Cannot create SSL context: SSL trust store cannot be found: /home/vcap/.ssl/trust.pem (zeus.hana.prod.eu-central-1.whitney.dbaas.ondemand.com:23803))')

========================================

Followed the documentation below, but looks like it is not for "trial".

https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/0a99ed7085b8447cb303c43253f...

is there any way to access HDI containers of Cloud Foundry "trial" in Python?

Many thanks in advance,

Best Regards,
Venu

Accepted Solutions (0)

Answers (3)

Answers (3)

Vitaliy-R
Developer Advocate
Developer Advocate

For some more background on this you can have a look as well at my recent post https://blogs.sap.com/2020/04/14/secure-connection-from-hdbsql-to-sap-hana-cloud/

The simplest solution though would be to add `sslValidateCertificate='false',` like

conn = dbapi.connect(

address=hana.credentials['host'], 

port=int(hana.credentials['port']), 

user=hana.credentials['user'], 

password=hana.credentials['password'], 

sslValidateCertificate='false',

encrypt="true"

)
gregorw
Active Contributor

Have you tried the description in Connecting Python Application to SAP HANA (XSA)?

ZhangMingquan
Advisor
Advisor
0 Kudos

How to set up the connection using Node.js on Windows? I am getting the following error: The PSE file does not exist.

{"code":-10709,"message":"Connection failed (RTE:[300010] Cannot create SSL context: Error in api.SSL_CTX_set_default_pse_by_name C:\\Program Files\\SAP\\hdbclient\\ - SSL error [4129]: Unknown error, General error: 0x00001021 | SAPCRYPTOLIB | SSL_CTX_set_default_pse_by_name\nSAPCRYPTO API error\nThe PSE file does not exist.\n0xa1d50108 | TOKEN_TOKPSE | SSL_CTX_set_default_pse_by_name\nToken application not existing\nCannot open PSE (PSE=C:\\Program Files\\SAP\\hdbclient\\, SECUDIR=C:\\Program Files\\SAP\\hdbclient, user=I068527 I068527 I068527)\n0xa1d50108 | TOKEN_TOKPSE | sec_SSL_CTX_set_asc\nToken application not existing\n (ErrCode: 4129) (zeus.hana.prod.eu-central-1.whitney.dbaas.ondemand.com:32081))","sqlState":"","status":500}
aristobulo_cruz
Explorer
0 Kudos

for resolving the mistake, I set the conecction in this mode:

var conn_params =

{

serverNode: "zeus.hana.prod.us-east-1.....:port",

encrypt: true,

schema: "EDW_...",

uid: "SYSTEM",

pwd: "xxxxxx",

sslValidateCertificate: "false"

}

regards