Authentication “Access denied”
Posted: Mon Mar 02, 2020 10:52 am
I'm using SoftEther APIs to connect to a VPS and then try to build a VPN on that . I can successfully connect to server using IP and Port, then at Authentication step I get "Access denied" and no more details. The authentication step is using Password and HubName.
I've read the APIs codes deeply and I realized it using SHA0 algorithm to encrypt password and take a random arrays of bytes from server and use that as salt in encrypt method . So I've changed the encryption method at SoftEther Application to AES128 , AES256 and some others but the result has not been changed at all. I also tried to send password as an ASCII but none of them worked.
The exact API code without change:
upd. Thanks !
I've read the APIs codes deeply and I realized it using SHA0 algorithm to encrypt password and take a random arrays of bytes from server and use that as salt in encrypt method . So I've changed the encryption method at SoftEther Application to AES128 , AES256 and some others but the result has not been changed at all. I also tried to send password as an ASCII but none of them worked.
The exact API code without change:
Code: Select all
using (var softEther = new SoftEther(ip, port))
{
// the connection step that would pass successfully :
var connectResult = softEther.Connect();
if (!connectResult.Valid())
{
Console.WriteLine(connectResult.Error);
return;
}
// the Authentication step that got problem :
var authResult = softEther.Authenticate(pw, hubName);
if (!authResult.Valid())
{
Console.WriteLine(authResult.Error);
return;
}
// the code stops and don't get here :
var user = softEther.HubApi.GetUser(hubName, userName);
Console.WriteLine(user.Valid() ? "Success" :
user.Error.ToString());
}