You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TNS connect descriptors may wrap parameter values in double quotes. This is the form Oracle publishes for Autonomous Database (tnsnames.ora downloaded from the OCI console), where ssl_server_cert_dn contains commas:
(description=(retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=xxxx_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)(ssl_server_cert_dn="CN=adwc.uscom-east-1.oraclecloud.com, OU=Oracle BMCS US, O=Oracle Corporation, L=Redwood City, ST=California, C=US")))
go-ora fails to connect with such descriptors, in both v2 and v3:
Quoted values sent on the wire. go-ora forwards the descriptor to the listener unchanged, including the double quotes. The listener rejects the connect packet and the client receives ORA-12564: TNS:connection refused. The Oracle Instant Client strips the outer quotes before sending the connect packet (verified by capturing both clients' connect packets against a local TCP listener).
Quoted SERVICE_NAME not parsed.SERVICE_NAME="my_service" does not match the SERVICE_NAME regex in configurations/database_info.go ([\w.-]+), so the service name is not extracted.
Commas split in BuildJDBC/BuildUrl.BuildUrl splits every option value on , and emits one query parameter per fragment. For the connStr option this breaks the descriptor at every comma inside the DN, so ssl_server_cert_dn values with commas cannot be passed through BuildJDBC.
With the same descriptor, the Oracle Instant Client (thick mode) connects successfully.
Expected behaviour
go-ora matches the Oracle client: outer double quotes on descriptor values are stripped before local parsing and before the connect packet is serialized, and connStr passed through BuildJDBC is preserved intact.
Versions
go-ora: v2 (master) and v3 (master)
Database: Oracle Autonomous Database 19c and 26ai, TCPS with wallet
Activity