SoftEther身份验证“访问被拒绝”

时间:2019-08-05 05:35:38

标签: c# .net api server vpn

我正在使用SoftEther APIs连接到VPS,然后尝试在该VPN上构建VPN。 我可以使用IP和端口成功连接到服务器,然后在“身份验证”步骤中显示“访问被拒绝”,没有更多详细信息。 身份验证步骤是使用密码和HubName。

我已经阅读了API的代码,并意识到我使用SHA0算法来加密密码并从服务器获取随机字节数组,并将其用作加密方法中的盐。 因此,我已将SoftEther Application的加密方法更改为AES128AES256和其他一些加密方法,但是结果完全没有改变。 我还尝试过以ASCII的身份发送密码,但没有一个起作用。

没有更改的确切API代码:

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()); 
}

这就是我得到的authResult

1 个答案:

答案 0 :(得分:-1)

好吧,既然您在SoftEther的服务器端工作,我会建议您使用VPNCMD来管理或从SoftEther服务器获取信息。

VPNCMD虚拟集线器命令: https://www.softether.org/4-docs/1-manual/6._Command_Line_Management_Utility_Manual/6.4_VPN_Server_%2F%2F_VPN_Bridge_Management_Command_Reference_(For_Virtual_Hub)

例如,在cmd / terminal中输入以下内容:

vpncmd /服务器{serverIP} / PASSWORD:{服务器密码} / adminhub:{服务器HUB名称} / CMD UserCreate {用户名} / GROUP:{groupname} / REALNAME:{user fullname} / NOTE:{anything}

要求: 下载并安装适用于您的机器操作系统的SoftEther服务器管理器(即您要从其控制远程服务器的位置)

您还可以从VPNCMD执行VPN客户端功能:https://www.softether.org/4-docs/1-manual/6._Command_Line_Management_Utility_Manual/6.5_VPN_Client_Management_Command_Reference