Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODP.NET Core - strange behaviour with SEPS wallet

unixwitchNov 13 2022

Hello,
I'm trying to use a SEPS wallet in ODP.NET Core, but I'm running into an odd issue that I think might be a bug.
The setup is as follows:
* Server is 21c (12.3.0.0.0) on Windows Server 2022
* Client is 21c (12.3.0.0.0) on Windows 11, 64-bit
* Application is using .NET 6.0 and ODP.NET Core 3.21.80
I have created a wallet with mkstore, and created a TNS admin directory containing the appropriate sqlnet.ora and tnsnames.ora files. sqlnet.ora contains the WALLET_LOCATION.
If I set the TNS_ADMIN environment variable and use "sqlplus /@tnsname", everything works fine using the wallet credentials.
If I set the TNS_ADMIN environment variable before starting my application, the application works fine and connects to Oracle using the wallet credentials.
However, if don't set the environment variable, but instead set the TNS admin directory using the TNS_ADMIN option in the ODP.NET Core connection string, the connection fails. The application seems to load the tnsnames.ora and attempts to connect to the database, but logon fails with ORA-01017: invalid username/password; login denied.
Using the connection string method, the trace file contains this:
(PRI) (.NET) (sqlnet.ora) Searching for 'C:\<...>\tns-admin\sqlnet.ora' : found!
(CFG) (SQLNET) WALLET_LOCATION : (SOURCE =(METHOD = FILE)(METHOD_DATA =(DIRECTORY = C:\<...>\rgwallet)))
(CFG) (SQLNET) SQLNET.WALLET_OVERRIDE : TRUE
(CFG) (SQLNET) SSL_CLIENT_AUTHENTICATION : FALSE
(CFG) (SQLNET) SSL_VERSION : 0
(PRI) (.NET) (tnsnames.ora) Searching for 'C:\<...>\tns-admin\tnsnames.ora' : found!
(CFG) (TNSNAMES) rgtest : (DESCRIPTION=(ADDRESS = (PROTOCOL = TCP)(HOST = ws2022.localdev)(PORT = 1521))(CONNECT_DATA =(SERVICE_NAME=reportgate)))
(PRI) (.NET) (ldap.ora) Searching for 'C:\<...>\tns-admin\ldap.ora' : not found
(PRI) (BUF) (COBP.CTOR) (poolid:1) (parentpoolid:1689058) (OracleConnectionImpl.Connect)
(PRI) (.NET) (tnsnames.ora) Searching for 'C:\<...>\Debug\net6.0\.\tnsnames.ora' : not found
(PRI) (.NET) (tnsnames.ora) Searching for 'C:\<...>\tnsnames.ora' : not found
(CFG) (SQLNET) FilePath : (null)
(CFG) (TNSNAMES) FilePath : (null)
If I use the environment variable method instead, the last two lines show the correct location of the sqlnet.ora and tnsnames.ora files, so it seems like the driver is correctly locating the files, then somehow forgetting about them.
Is this a bug or am I misunderstanding how this should work?

Comments
Post Details
Added on Nov 13 2022
5 comments
648 views