Forum Stats

  • 3,875,722 Users
  • 2,266,954 Discussions
  • 7,912,318 Comments

Discussions

.NET Core: Cannot connect using Oracle Wallet

James Driscoll
James Driscoll Member Posts: 15 Red Ribbon
edited Apr 6, 2021 10:33AM in ODP.NET

Hi!

I am trying to connect to the database using Oracle Wallet and Oracle.ManagedDataAccess.Core v3.21.1

In my SQLNET.ora I have:


WALLET_LOCATION =

  (SOURCE =

   (METHOD = FILE)

   (METHOD_DATA =

    (DIRECTORY = C:\Temp\wallet\wallet_test)

  ))

SQLNET.WALLET_OVERRIDE = TRUE


From the command line I can run this and successfully connect.


sqlplus /@database.alias


In a simple .NET Console application I have:


OracleConfiguration.WalletLocation = @"(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=c:\temp\wallet\wallet_test)))";

OracleConfiguration.SqlNetWalletOverride = true;

OracleConfiguration.TnsAdmin = @"C:\Temp\wallet";

OracleConfiguration.TraceLevel = 7;

OracleConfiguration.TraceFileLocation = @"C:\temp\wallet";

OracleConfiguration.TraceOption = 7;

using var connection = new OracleConnection("User ID=/; Data Source=database.alias");

connection.Open();


And I receive Oracle.ManagedDataAccess.Client.OracleException: 'ORA-01017: invalid username/password; logon denied'


In my trace file I have:


2021-03-30 14:55:56.109247 TID:1  (PRI) (CP) OraclePoolManager.FetchSEPSCredentails() FetchSEPSCredentails => Querying Data Source (TRIAL: 0): database.alias

2021-03-30 14:55:56.125621 TID:1  (NET) (SQLNET) Wallet Location = c:\temp\wallet

2021-03-30 14:55:56.212667 TID:1  (NET) (SQLNET) SEPS userid is null.

2021-03-30 14:55:56.212819 TID:1  (NET) (SQLNET) SEPS password is null.

2021-03-30 14:55:56.212840 TID:1  (PRI) (CP) OraclePoolManager.FetchSEPSCredentails() FetchSEPSCredentails => Got Credentials from Client Wallet


Am I missing something blindly obvious?

Thanks,

James

«13

Answers

  • Christian.Shay -Oracle
    Christian.Shay -Oracle Posts: 2,245 Employee
    edited Apr 1, 2021 8:16PM

    Hi James,

    <incorrect information about sqlnet.ora wallet path deleted>

    (Also, only Windows is currently supported)

    Thanks,

    Christian

  • James Driscoll
    James Driscoll Member Posts: 15 Red Ribbon
    edited Apr 6, 2021 1:56PM

    Hi Christian,

    Sorry, I (originally) mis-posted above... the two paths are identical (now corrected).

    Also, this is running on Windows.

    I am struggling to find documentation on this... can you point me in the right direction?

    Are there plans to support Linux too?

    Thanks,

    James

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 3,154 Employee

    Here's the doc for setting up ODP.NET SEPS.

    When you say the paths are identical, do you mean that both SQL*Plus and ODP.NET are using c:\temp\wallet?

  • James Driscoll
    James Driscoll Member Posts: 15 Red Ribbon

    Hi Alex!

    Yes - both sets of config are pointing to the same path.

    I just badly redacted one of the paths!

    Thanks,

    James

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 3,154 Employee

    Hi James,

    Does your wallet happen to be larger than 64K? We have noticed a problem with wallets larger than that.

  • Christian.Shay -Oracle
    Christian.Shay -Oracle Posts: 2,245 Employee
    edited Apr 1, 2021 8:19PM

    FYI - I deleted some incorrect information I posted earlier about sqlnet.ora wallet path. (It CAN be overridden by OracleConfiguration.WalletLocation ).

    Sorry about that.

  • James Driscoll
    James Driscoll Member Posts: 15 Red Ribbon

    Hi Alex, the wallet is 49KB.

  • James Driscoll
    James Driscoll Member Posts: 15 Red Ribbon

    Hi Alex / Christian,

    I have done a whole lot more digging, and can confirm the following:

    1. The wallet I was originally given came from our DBAs with 123 entries and is 49KB
    2. If I create a new wallet with just the same credentials that I require, it connects correctly.
    3. If I delete the credential and recreate it, I can connect
    4. If I create a new wallet with 128 dummy entries followed by the entry I require, it still connects correctly (and is 51KB in size)
    5. If I write a for loop and iterate over the 123 entries in the failing wallet, some connect, others don't
    6. The wallet that we will be using when we go live will be ~790KB
    7. If I use this wallet, then none of those connections succeeds
    8. I have then created a brand new wallet with the first failing entry (and that alone)
    9. This is for a test database, uses an obsolete schema with an expired password
    10. This works in SQL*Plus: ORA-28001: the password has expired
    11. But fails in C#: ORA-01017: invalid username/password; logon denied

    Assuming that you have access to my email address, if you reach out directly, I can share further details with you directly.

    Thanks,

    James

  • James Driscoll
    James Driscoll Member Posts: 15 Red Ribbon

    Also, only Windows is currently supported

    Are there plans to support Linux?

    If so, is there a timeline?

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 3,154 Employee

    Hi James,

    Yes, we plan to support ODP.NET Core SEPS with Linux and to also fix the 64 KB bug along with it, The timing is TBD.

    Your findings suggest there may be some particular part of the original wallet file that ODP.NET Core is not handling properly. Is it possible to share your full ODP.NET trace and your wallet file? I realize the latter is a more difficult request, but perhaps you have a test wallet that reproduces the error.

    I have communicated with a couple of James Driscolls over the years. To avoid reaching out to the wrong one, you can send me an email at alex.keh(at)oracle.com.