error: Couldn't acquire crypto service provider context.
Posted: Fri 01 May 2020 09:16
Hi, our customer said they always failed to connect to MySQL by SSL and get an error: Couldn't acquire crypto service provider context.
we internally use Devart.Data.MySql.MySqlConnection to connect to Mysql Server by SSL.
the connection string is: User=root;Password=1234;Connection Timeout=15;Pooling=false;Unicode=true;ssl ca cert=;ssl cert=;ssl key=;Server=10.154.10.78;Protocol=SSL
on my computer, I found when connection.open(), there's a folder named after <user SID> generated in the folder: C:\Users\<username>\AppData\Roaming\Microsoft\Crypto\RSA\.
the newly generated folder name is: S-1-12-1-xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxx, and it is user's SID.
since I see it's located on userprofile folder, I think the customer should always have permission to write into his folder as well, or maybe it could be located in some other place?
I see this post on your forum: https://forums.devart.com/viewtopic.php?t=25128, and it is said the folder for generating SSL related folder is: ProgramData\Microsoft\Crypto\RSA' , different from my case.
so my question is:
1. where is the folder should be located? if you use a system variable to find the location, what is the system variable?
2. I see the folder in my working machine is empty, so why do you need to create this folder? If I use mysql's own client(mysql.exe) to created a SSL connection, I found no such folder is generated.
3. Is there some other reason for causing this error "Couldn't acquire crypto service provider context."?
we internally use Devart.Data.MySql.MySqlConnection to connect to Mysql Server by SSL.
the connection string is: User=root;Password=1234;Connection Timeout=15;Pooling=false;Unicode=true;ssl ca cert=;ssl cert=;ssl key=;Server=10.154.10.78;Protocol=SSL
on my computer, I found when connection.open(), there's a folder named after <user SID> generated in the folder: C:\Users\<username>\AppData\Roaming\Microsoft\Crypto\RSA\.
the newly generated folder name is: S-1-12-1-xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxx, and it is user's SID.
since I see it's located on userprofile folder, I think the customer should always have permission to write into his folder as well, or maybe it could be located in some other place?
I see this post on your forum: https://forums.devart.com/viewtopic.php?t=25128, and it is said the folder for generating SSL related folder is: ProgramData\Microsoft\Crypto\RSA' , different from my case.
so my question is:
1. where is the folder should be located? if you use a system variable to find the location, what is the system variable?
2. I see the folder in my working machine is empty, so why do you need to create this folder? If I use mysql's own client(mysql.exe) to created a SSL connection, I found no such folder is generated.
3. Is there some other reason for causing this error "Couldn't acquire crypto service provider context."?