Forum Stats

  • 3,769,900 Users
  • 2,253,029 Discussions
  • 7,875,233 Comments

Discussions

cx_oracle.makedsn - TCPS

user13283765
user13283765 Member Posts: 47
edited Jan 26, 2015 3:51PM in Python

Hello All,

I have a requirement to have certain connections need to be secured using SSL and wallet. I've got the wallet part all setup, however I am unable to find how to force the connection from python to use the protocol TCPS.

The makedsn do not seem to offer this option. Can anybody suggest a workaround or do I need to physically make a change to the python package to have the protocol TCPS?

Default behavior is

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

cx_Oracle.makedsn("myhost", 1523, "MYSERVICE")

Thanks in advance

JS

Best Answer

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,643 Employee
    edited Jan 26, 2015 3:51PM Accepted Answer

    I suggest not using makedsn.  All it does (see cx_Oracle.c) is:

       format = cxString_FromAscii("(DESCRIPTION=(ADDRESS_LIST=(ADDRESS="

                "(PROTOCOL=TCP)(HOST=%s)(PORT=%s)))(CONNECT_DATA=(SID=%s)))");

    Since SIDs were deprecated a while back, and you probably want a service name, I'd configure a tnsnames.ora file and just use the connect identifier in the cx_Oracle connect() call.


    Or, if you don't need any other TNS configuration, don't use a tnsnames.ora file and instead just use the Easy Connect syntax in connect(): "myhost:1523/MYSERVICE"

Answers

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,643 Employee
    edited Jan 26, 2015 3:51PM Accepted Answer

    I suggest not using makedsn.  All it does (see cx_Oracle.c) is:

       format = cxString_FromAscii("(DESCRIPTION=(ADDRESS_LIST=(ADDRESS="

                "(PROTOCOL=TCP)(HOST=%s)(PORT=%s)))(CONNECT_DATA=(SID=%s)))");

    Since SIDs were deprecated a while back, and you probably want a service name, I'd configure a tnsnames.ora file and just use the connect identifier in the cx_Oracle connect() call.


    Or, if you don't need any other TNS configuration, don't use a tnsnames.ora file and instead just use the Easy Connect syntax in connect(): "myhost:1523/MYSERVICE"

This discussion has been closed.