OpenVpn from C# - Weird Timeout - c#

i am trying to start OpenVpn from my C# Windows Service. Basically like this:
VpnProcess = new Process();
VpnProcess.StartInfo.FileName = "<Path to openvpn.exe in Program dir>";
VpnProcess.StartInfo.Arguments = "--config " + "<vpnConfigName>" + " --log vpn.log";
VpnProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
VpnProcess.StartInfo.UseShellExecute = false;
VpnProcess.StartInfo.CreateNoWindow = true;
VpnProcess.StartInfo.WorkingDirectory = <Program dir>;
VpnProcess.Start();
so far so good, here is the resulting log:
Tue Sep 01 11:01:15 2015 OpenVPN 2.3.8 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [PKCS11] [IPv6] built on Aug 4 2015
Tue Sep 01 11:01:15 2015 library versions: OpenSSL 1.0.1p 9 Jul 2015, LZO 2.08
Tue Sep 01 11:01:16 2015 Socket Buffers: R=[8192->8192] S=[8192->8192]
Tue Sep 01 11:01:16 2015 UDPv4 link local: [undef]
Tue Sep 01 11:01:16 2015 UDPv4 link remote: [AF_INET]217.79.181.93:1194
Tue Sep 01 11:01:16 2015 TLS: Initial packet from [AF_INET]217.79.181.93:1194, sid=a7a52cba 93615557
Tue Sep 01 11:01:16 2015 VERIFY OK: depth=1, CN=<censored>
Tue Sep 01 11:01:16 2015 VERIFY OK: nsCertType=SERVER
Tue Sep 01 11:01:16 2015 VERIFY OK: depth=0, C=<censored>, ST=<censored>, L=<censored>, O=<censored>, OU=<censored>, CN=<censored>, name=<censored>, emailAddress=<censored>
Tue Sep 01 11:02:16 2015 [<censored>] Inactivity timeout (--ping-restart), restarting
Tue Sep 01 11:02:16 2015 SIGUSR1[soft,ping-restart] received, process restarting
Tue Sep 01 11:02:16 2015 Restart pause, 2 second(s)
Tue Sep 01 11:02:18 2015 Socket Buffers: R=[8192->8192] S=[8192->8192]
Tue Sep 01 11:02:19 2015 UDPv4 link local: [undef]
Tue Sep 01 11:02:19 2015 UDPv4 link remote: [AF_INET]217.79.181.93:1194
Tue Sep 01 11:02:19 2015 TLS: Initial packet from [AF_INET]217.79.181.93:1194, sid=4963868b 6f0eecb7
Tue Sep 01 11:02:20 2015 VERIFY OK: depth=1, CN=<censored>
Tue Sep 01 11:02:20 2015 VERIFY OK: nsCertType=SERVER
Tue Sep 01 11:02:20 2015 VERIFY OK: depth=0, C=<censored>, ST=<censored>, L=<censored>, O=<censored>, OU=<censored>, CN=<censored>, name=<censored>, emailAddress=<censored>
Tue Sep 01 11:02:21 2015 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
[...]
Tue Sep 01 11:02:28 2015 Initialization Sequence Completed
So, vpn hangs after VERIFY, then restarts itself, then its working fine. If i start openvn via cmd or Powershell with the exact same conditions and params, it connects successfully in the first try.
I spent several days trying to find out why this happens, no success. I tried all sensible combinations of StartInfo-Properties and checked whether the executing user changes after the soft restart. Nope, both times it's LocalSystem.

Cause: server time was 1 minute ahead of time. So the freshly downloaded certificate on client was 'from the future', leading to rejection by the server. Server log showed this, but never client log

Check your OpenVPN config file do you have option 'auth-nocache'.
I got a similar effect when I've added this option to client configuration. I use username / password to authenticate.

Related

Missing "Microsoft.CodeAnalysis" in .net 3.1 install on Ubuntu

I have a .net project that runs in windows with VS code with no issues.
I am trying to run the same project in Ubuntu 20.04.2 with VS code. Run trying to run it with F5, I get the errors:
CSC : error CS8032: An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from /home/one/.nuget/packages/system.text.json/6.0.6/analyzers/dotnet/roslyn3.11/cs/System.Text.Json.SourceGeneration.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.11.0.0, Culture=neutral, PublicKeyToken=****'. The system cannot find the file specified.. [/home/one/github/fhir/Foo.Service/Foo.Service/Foo.Service.csproj]
CSC : error CS8032: An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from /home/one/.nuget/packages/system.text.json/6.0.6/analyzers/dotnet/roslyn4.0/cs/System.Text.Json.SourceGeneration.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.11.0.0, Culture=neutral, PublicKeyToken=******'. The system cannot find the file specified.. [/home/one/github/fhir/Foo.Service/Foo.Service/Foo.Service.csproj]
I verified the files are on my system:
roslyn3.11
% lr /home/one/.nuget/packages/system.text.json/6.0.6/analyzers/dotnet/roslyn3.11/cs/System.Text.Json.SourceGeneration.dll
-rwxrw-r-- 1 one one 148K Aug 19 19:48 /home/one/.nuget/packages/system.text.json/6.0.6/analyzers/dotnet/roslyn3.11/cs/System.Text.Json.SourceGeneration.dll
roslyn4.0
one#work ~
% lr /home/one/.nuget/packages/system.text.json/6.0.6/analyzers/dotnet/roslyn4.0/cs/System.Text.Json.SourceGeneration.dll
-rwxrw-r-- 1 one one 164K Aug 19 19:48 /home/one/.nuget/packages/system.text.json/6.0.6/analyzers/dotnet/roslyn4.0/cs/System.Text.Json.SourceGeneration.dll
csproj
one#work ~
% lr /home/one/github/fhir/Foo.Service/Foo.Service/Foo.Service.csproj
-rw-rw-r-- 1 one one 1.8K Nov 10 16:59 /home/one/github/fhir/Foo.Service/Foo.Service/Foo.Service.csproj
It looks like "Microsoft.CodeAnalysis" was missing. So, I installed it with nuget in VS code. I added 'nuget: add package' in VS code to install 'Microsoft.CodeAnalaysis' version 3.11.0.
I have verified it successfully lives on my system:
one#work ...packages/microsoft.codeanalysis/3.11.0
% pwd
/home/one/.nuget/packages/microsoft.codeanalysis/3.11.0
one#work ...packages/microsoft.codeanalysis/3.11.0
% lr
total 80K
drwxrwxr-x 2 one one 4.0K Nov 14 10:08 .
drwxrwxr-x 4 one one 4.0K Nov 14 10:08 ..
-rw-rw-r-- 1 one one 178 Nov 14 10:08 .nupkg.metadata
-rwxrw-r-- 1 one one 19K Aug 10 2021 .signature.p7s
-rwxrw-r-- 1 one one 6.9K Apr 30 2021 Icon.png
-rwxrw-r-- 1 one one 2.2K Aug 3 2021 ThirdPartyNotices.rtf
-rw-rw-r-- 1 one one 28K Nov 14 10:08 microsoft.codeanalysis.3.11.0.nupkg
-rw-rw-r-- 1 one one 88 Nov 14 10:08 microsoft.codeanalysis.3.11.0.nupkg.sha512
-rwxrw-r-- 1 one one 2.4K Aug 3 2021 microsoft.codeanalysis.nuspec
I still get the errors mentioned above.

Progress OpenEdge ERROR [60] [DataDirect][ODBC 20101 driver]6013

I have issue when trying to connect to a progress openedge database using odbc. The client code is in c# and running in docker. Here is my code :
using (OdbcConnection cn = new OdbcConnection("DSN=PROGRESS;UID=username;PWD=pass;"))
{
cn.Open();
}
The issue is that program is crashing at the cn.Open() with the following error : ERROR [60] [DataDirect][ODBC 20101 driver]6013.
I can successfully connect using isql -v PROGRESS username pass and I can query tables.
Environnement :
It is a .NET Core app on a docker environment. Here is my odbc.ini file :
[PROGRESS]
Driver=/usr/lib/x86_64-linux-gnu/pgoe27.so
HostName=192.168.2.11
DatabaseName=dbname
LogonID=username
Password=pass
PortNumber=20000
[ODBC]
Trace=0
TraceFile=odbctrace.out
TraceDll=/usr/lib/openedge/lib/pgtrc27.so
InstallDir=/usr/lib/openedge
I do not understand why I can connect using isql but not using c# OdbcConnection...
Thanks in advance
EDITED
Here is my odbc folder permissions :
# ls -l lib
total 27124
-rwxr-xr-x 1 root root 1782648 Aug 2 13:09 libodbc.so
-rwxr-xr-x 1 root root 1280424 Aug 2 13:09 libodbcinst.so
-rwxr-xr-x 1 root root 14682952 Aug 2 13:09 libpgicu27.so
-rwxr-xr-x 1 root root 1468736 Aug 2 13:09 libpgmback.so
-rwxr-xr-x 1 root root 2351288 Aug 2 13:09 libpgssl27.so
-rwxr-xr-x 1 root root 1586488 Aug 2 13:09 odbccurs.so
-rwxr-xr-x 1 root root 2871272 Aug 2 13:09 pgoe27.so
-rwxr-xr-x 1 root root 1667632 Aug 2 13:09 pgtrc27.so
-rwxr-xr-x 1 root root 63800 Aug 2 13:09 vscnctdlg.so
# ls -lR locale
locale:
total 8
drwxrwxrwx 1 root root 4096 Aug 2 13:09 en_US
locale/en_US:
total 4
drwxrwxrwx 1 root root 4096 Aug 2 13:09 LC_MESSAGES
locale/en_US/LC_MESSAGES:
total 208
-rw-rw-r-- 1 root root 36241 Aug 2 13:09 odbc.m
-rw-rw-r-- 1 root root 19099 Aug 2 13:09 odbc.po
-rw-rw-r-- 1 root root 19096 Aug 2 13:09 pgmback.mo
-rw-rw-r-- 1 root root 11581 Aug 2 13:09 pgmback.po
-rw-rw-r-- 1 root root 72722 Aug 2 13:09 pgoe27.mo
-rw-rw-r-- 1 root root 47627 Aug 2 13:09 pgoe27.po
I have managed connecting specifying connection in my .net program, but I still cannot using DSN + odbc.ini :
OdbcConnectionStringBuilder builder = new OdbcConnectionStringBuilder
{
Driver = "/usr/lib/openedge/lib/pgoe27.so",
};
builder.Add("HostName", "192.168.2.11");
builder.Add("DatabaseName", "PROGRESS");
builder.Add("LogonID", "username");
builder.Add("Password", "password");
builder.Add("PortNumber", "20000");
using (OdbcConnection cnGlims = new OdbcConnection(builder.ConnectionString))
{
cnGlims.Open();
}
According to the Progress Knowledgebase the fact that you are getting error numbers (60, 6013) rather than an error message indicates a configuration problem preventing the message description files from being loaded.
https://knowledgebase.progress.com/articles/Knowledge/3556 says:
Cause: The ODBC driver manager and/or the ODBC driver library cannot
load its message files.
InstallDir is not set correctly in the [ODBC] section of the odbc.ini
file or the message files in locale/en_US/LC_MESSAGES are missing.
Make sure the following are set correctly:
Set the environment variable LANG to en_US :
export LANG=en_US (ksh shell)
setenv LANG en_US (csh shell)
Ensure that the environment variable ODBCINI (or ODBC_INI) is pointing
to the proper odbc.ini file
Ensure that in the [ODBC] section of your odbc.ini file the correct
installation path of the ODBC drivers is specified for InstallDir
e.g. InstallDir=/opt/odbc
Make sure the .mo / .po messages files exist
(odbcinstaldir/locale/en_US/LC_MESSAGES) and can be loaded by your
application
If your installDir is /usr/lib/openedge then you should test for the existence (and permissions) of these files like so:
$ cd /usr/lib/openedge
$ ls -l ./odbc/lib
total 29832
-rwxrwxr-x. 1 root root 1676480 Jan 21 2020 libodbcinst.so
-rwxrwxr-x. 1 root root 2182544 Jan 21 2020 libodbc.so
-rwxrwxr-x. 1 root root 14682952 Jan 21 2020 libpgicu27.so
-rwxrwxr-x. 1 root root 1977640 Jan 21 2020 libpgmback.so
-rwxrwxr-x. 1 root root 2359016 Jan 21 2020 libpgssl27.so
-rwxrwxr-x. 1 root root 2065616 Jan 21 2020 odbccurs.so
-rwxrwxr-x. 1 root root 3383128 Jan 21 2020 pgoe27.so
-rwxrwxr-x. 1 root root 2142864 Jan 21 2020 pgtrc27.so
-rwxrwxr-x. 1 root root 63800 Jan 21 2020 vscnctdlg.so
$ ls -lR ./odbc/locale
./odbc/locale:
total 0
drwxrwxrwx. 3 root root 25 Apr 10 2020 en_US
./odbc/locale/en_US:
total 0
drwxrwxrwx. 2 root root 105 Apr 10 2020 LC_MESSAGES
./odbc/locale/en_US/LC_MESSAGES:
total 212
-rw-rw-r--. 1 root root 36241 Jan 21 2020 odbc.m
-rw-rw-r--. 1 root root 19099 Jul 29 2011 odbc.po
-rw-rw-r--. 1 root root 19096 Jan 21 2020 pgmback.mo
-rw-rw-r--. 1 root root 11581 Jul 29 2011 pgmback.po
-rw-rw-r--. 1 root root 74007 Jan 21 2020 pgoe27.mo
-rw-rw-r--. 1 root root 49045 Jan 21 2020 pgoe27.po

DST Entry time for few Timezone (Europe/Nicosia) are reporting wrong date using System.Globalization C#

I'm trying to get the DST entry time for the timezone "Antarctica/McMurdo" for the current year 2020 using System.Globalization class in C#. i'm receiving them as
DST Entry Time: 9/29/2020 2:00:00 AM
DST Exit Time: 4/5/2020 2:59:59 AM
But the actual DST entry time supposed to be on 9/27/2020 2:00:00 AM according to https://www.timeanddate.com/time/change/antarctica/mcmurdo
The received entry time is already in DST because of which my test program is failing as the time shift is not happening.
Below is the code snippet used
var currTimeZone = TimeZone.CurrentTimeZone;
var dstInfo = currTimeZone.GetDaylightChanges(now.Year);
DSTEntry = dstInfo.Start.ToString();
Below are the versions of Mono and Ubuntu i'm running on
Ubuntu 16.04.3 LTS
Mono JIT compiler version 5.4.0.201
Here is the output of zdump
$ zdump Antarctica/McMurdo -v 2019,2022
Antarctica/McMurdo Sat Apr 6 13:59:59 2019 UT = Sun Apr 7 02:59:59 2019 NZDT isdst=1 gmtoff=46800
Antarctica/McMurdo Sat Apr 6 14:00:00 2019 UT = Sun Apr 7 02:00:00 2019 NZST isdst=0 gmtoff=43200
Antarctica/McMurdo Sat Sep 28 13:59:59 2019 UT = Sun Sep 29 01:59:59 2019 NZST isdst=0 gmtoff=43200
Antarctica/McMurdo Sat Sep 28 14:00:00 2019 UT = Sun Sep 29 03:00:00 2019 NZDT isdst=1 gmtoff=46800
Antarctica/McMurdo Sat Apr 4 13:59:59 2020 UT = Sun Apr 5 02:59:59 2020 NZDT isdst=1 gmtoff=46800
Antarctica/McMurdo Sat Apr 4 14:00:00 2020 UT = Sun Apr 5 02:00:00 2020 NZST isdst=0 gmtoff=43200
Antarctica/McMurdo Sat Sep 26 13:59:59 2020 UT = Sun Sep 27 01:59:59 2020 NZST isdst=0 gmtoff=43200
Antarctica/McMurdo Sat Sep 26 14:00:00 2020 UT = Sun Sep 27 03:00:00 2020 NZDT isdst=1 gmtoff=46800
Antarctica/McMurdo Sat Apr 3 13:59:59 2021 UT = Sun Apr 4 02:59:59 2021 NZDT isdst=1 gmtoff=46800
Antarctica/McMurdo Sat Apr 3 14:00:00 2021 UT = Sun Apr 4 02:00:00 2021 NZST isdst=0 gmtoff=43200
Antarctica/McMurdo Sat Sep 25 13:59:59 2021 UT = Sun Sep 26 01:59:59 2021 NZST isdst=0 gmtoff=43200
Antarctica/McMurdo Sat Sep 25 14:00:00 2021 UT = Sun Sep 26 03:00:00 2021 NZDT isdst=1 gmtoff=46800
Can someone help me how to resolve this timing issue? or is this a bug from DLL/timezone_database which C# is reading from?
Thanks
From the documentation on the TimeZone class:
Warning
This API is now obsolete
...
ⓘ Important
Whenever possible, use the TimeZoneInfo class instead of the TimeZone
class.
...
The TimeZone class supports only a single daylight saving time
adjustment rule for the local time zone. As a result, the TimeZone
class can accurately report daylight saving time information or
convert between UTC and local time only for the period in which the
latest adjustment rule is in effect. In contrast, the TimeZoneInfo
class supports multiple adjustment rules, which makes it possible to
work with historic time zone data.
In short, don't use the TimeZone class.

How to FindElement By Xpath in Selenium PhantomJS C#

This is the structure:
<div id="footer">
<div id="debugTxt" style="color:blue;">Wed Jul 27 2016 10:06:12 GMT+0800 (Sample)Sample<br>
Sample<br>
Wed Jul 27 2016 10:06:12 GMT+0800 (Sample) Sample<br>
Wed Jul 27 2016 10:06:12 GMT+0800 (Sample) Sample!<br>
Wed Jul 27 2016 10:06:12 GMT+0800 (Sample) <br>
DataTOGET:http://Please.Get.Me<br>
</div>
</div>
This is what I'm trying to do:
driver1.FindElement(By.XPath(".//*[#id='debugTxt']")).GetAttribute("value");
Is it possible to get the value of http://Please.Get.Me ?
You should just tweak your expression to match the a element inside the div:
driver1.FindElement(By.XPath(".//*[#id='debugTxt']/a")).GetAttribute("href");
With a little tweak and help from alecxe
driver1.FindElement(By.XPath("//*[#id='debugTxt']//a")).GetAttribute("href");
I think you want visible text of the link, you should try using .Text as below :-
driver1.FindElement(By.XPath(".//*[#id='debugTxt']/a")).Text;

Oracle.ManagedDataAccess and ORA-01017: invalid username/password; logon denied

I have a challenging situation on one of our servers. I have an ASP.NET MVC 3 application that needs to connect to an Oracle 12c database. It does so using the following connection string:
User ID=myuserid;Password=mypass;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<IP ADDRESS>)(PORT = 1521)))(CONNECT_DATA=(SERVICE_NAME=PDB1)));
I'm also using Oracle's Oracle.ManagedDataAccess, version 4.121.1.0. Each attempt to connect results in the following error:
ORA-01017: invalid username/password; logon denied
I can connect successfully on my desktop with the above credentials. I have the same code on another server, but using an older, un-managed version of the library, and it can connect successfully with the aforementioned credentials. However, the server on which I would like my code to run fails every single time using the same credentials that enable successful connections on different servers.
On the server that fails, I can:
connect via SQLPLUS
hit the database with TNSPING
Create a System DSN to establish an ODBC connection
I have checked the TNSNAMES.ORA in all locations and they appear to be correct.
After hitting the database too many times, the account actually locked indicating that I was, indeed, hitting the database and that the database did not like the credentials presented. I checked the applications that previously connected successfully and they also failed with an error indicating that the account was locked. Unlocking the account caused those applications to connect successfully with the exception of the server with which I am having problems.
I am at my wit's end.
Does anyone have any other suggestions as to what might cause this problem?
EDIT:
I installed WireShark on my local computer and on the offending server. I captured communication between my desktop and the database as well as the offending server and the database. I found that my desktop communicated the password:
0080 35 42 31 41 43 34 30 00 01 01 01 0d 0d 41 55 54 5B1AC40......AUT
0090 48 5f 50 41 53 53 57 4f 52 44 01 40 40 43 30 36 H_PASSWORD.##C06
00a0 37 39 42 31 31 42 46 36 42 41 43 44 39 30 38 44 79B11BF6BACD908D
00b0 37 39 34 34 31 31 46 34 32 33 30 42 34 36 44 36 794411F4230B46D6
00c0 35 36 36 33 31 42 45 39 39 41 36 43 36 37 42 44 56631BE99A6C67BD
00d0 43 33 35 42 42 44 36 44 42 45 37 34 36 00 01 0d C35BBD6DBE746...
whereas the server with which I am having problems, did not (or at least that's the assumption):
0080 39 33 39 37 32 33 46 00 01 01 01 0d 0d 41 55 54 939723F......AUT
0090 48 5f 50 41 53 53 57 4f 52 44 01 40 40 00 00 00 H_PASSWORD.##...
00a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 0d ................
Does anyone know of a security/configuration setting that would prevent passwords from being transmitted even though they are present in the connection string?
Edit (20180713):
In my particular case, the issue was the FIPS setting.
For those doing research, there are several ways around this.
You can alter the registry setting located at HKLM\System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy\Enabled. If FIPS is enabled, the value is 1. If disabled, the value is 0. You do not need to reboot.
Most likely, the reason why you are running into this issue is that FIPS is enabled and you are using the Oracle managed data access library. A solid workaround is to use the unmanaged library. However, to use this library, you need to install the Oracle Instant Client. The client is available for download in the Oracle Data Access Components.
Upgrade your server to Oracle 12.2c. Oracle 12c versions before 12.2c still have this problem.
If you do not have FIPS enabled, the most likely you will need to investigate whether your database has the SEC_CASE_SENSITIVE_LOGON setting set to true. You will need to execute ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE; and then reset all of your passwords.
I have been struggling with this same issue for a couple of weeks and finally have a resolution. I had to disable the FIPS security policy, try setting this key:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy]
"Enabled"=dword:00000000
to zero, it worked perfectly for me
I was following your thread your blank password issue eventually pointed me here:
https://community.oracle.com/thread/2557592?start=30&tstart=0
Based on Jeff's answer (10/31/2014)...
The registry setting can be set by GPO to only allow FIPS compliant algorithms. Setting this to 0 as indicated may be a violation of some security policies and get overwritten by the GPO. This registry setting controls more than just IIS or ASP.NET.
There is another way that is specific to .NET and may work at the application level. This is much easier to justify compared to modifying the settings of the whole server.
Application specific method:
In your Web.config or App.config file, add the following setting:
<configuration> <!-- Will already be there -->
<runtime>
<enforceFIPSPolicy enabled="false"/>
</runtime>
... the rest of your .config
If I remember correctly, this must be at the beginning of your config file.
All .NET application method:
Place the setting above in the machine.config file. There will be one for each .NET version and architecture (64 bit/32 bit). There will already be a element, so put the element inside it.
I had the same issue using Entity Framework and the Oracle.ManagedDataAccess.Client, but I had some success by uppercasing my password in the configuration connection string section.
I'm programming in C # with an Oracle xe 11g database, it had never happened to me before, but the new users that I created in the DB, when I tried to connect from the C# application, I got the error: ORA-01017: invalid username / password ; logon denied, only with new users (I did a migration from xe 10g to xe 11g) where migrated users from version 10g worked correctly.
I made this change in my connection string and managed to solve the problem
before
private string cadenaCone = "User Id=AAA111;Password=BBB222;Data Source=CCC333;Connection Timeout=60;";
after
private string cadenaCone = "User Id=AAA111;Password=" + ((char)34).ToString() + "BBB222"+((char)34).ToString()+";Data Source=CCC333;Connection Timeout=60;";
I did not quite have the same scenario as this case does, but I did have very similar results. What I did to sort out the problem was, I enclosed the password in quotes like the following (VB.NET):
cnx.ConnectionString = "User ID=MYID;Password=""MyPass"" ;Data Source=MyTEST"
or use chr(34) as follows
cnx.ConnectionString = "User ID=MYID;Password="+chr(34)+"MyPass"+chr(34)+" ;Data Source=MyTEST"
I had exactly same issue. When I was connecting to database directly from SqlDeveloper, it was working fine. But my application ( built on VB6) failed to connect to Oracle and giving error "ORA-01017 Invalid ID/password.
After turning off, case sensitive login for my database ID, it resolved the issue.
I had the same problem! I didn't try changing the RegKey but I did try changing the web and machine config. This did not work.
What did solve the problem was changing the app pool I was running under!
The App Pool was running under a service account and once I moved it to a new App Pool with just the default system account it started picking up the User ID and Password from the config.
I was trying with the command:
ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE;
But it didn't work.
I had to change it using the SQL Developer in the DBA tab.
Find the Parameter 'sec_case_sensitive_logon' and change its value to 'FALSE'
Commit your changes using the button:
It will ask the commit strategy and you have to choose both:
Click 'Apply'
I don't know if this step is required, but I also changed the user's password. (I set the same password)
In case, you don't know how to open the 'Initialization Parameters':
Open 'Oracle SQL Developer'
Go to 'View' menu and select 'DBA'
Choose a connection
And then click on 'Initialization Parameters'
For some reason (and have no idea why ) my c# code sends my username uppercased even though I write it as lowercase.
For example my username is kullaniciadi you may think uppercase of this would be KULLANICIADI but seems it's not. My server's locale is Turkish (I believe this is the reason) so uppercased version of my username becomes KULLANİCİADİ because in Turkish uppercase of i is İ and uppercase of ı is I. And this results invalid username error.
Had no control over database so can't change any settings on it.
Typing my username all uppercased solved the problem.
Also this only works in combination of accepted answer. If registry key mentioned in accepted answer is set to 1 then this answer may not work.
Spent lots of hours for this stupid thing. I'm writing this down so you won't.

Categories