【问题标题】:Connection to OPENVPN using c#使用 c# 连接到 OPENVPN
【发布时间】:2020-05-31 10:43:48
【问题描述】:

我正在创建一个 VPN 客户端,使用 Ikve2 和 openvpn,当涉及到 IKV2 时,它是直截了当的,但是 OPENVPN 我很难处理 OVPN 文件,因为我使用 FREERadius 作为身份验证如何传递用户名和密码?我已经尝试通过连接 用户锁定的个人资料。

【问题讨论】:

    标签: c# asp.net .net-core openvpn


    【解决方案1】:

    查看FreeRadius .net Code here

    //args = new string[4];
    //args[0] = "192.168.1.1";
    //args[1] = "secret";
    //args[2] = "username";
    //args[3] = "password";
    
    RadiusClient rc = new RadiusClient(args[0], args[1]);
    // Use username/password here
    RadiusPacket authPacket = rc.Authenticate(args[2], args[3]);
    authPacket.SetAttribute(new VendorSpecificAttribute(10135, 1, UTF8Encoding.UTF8.GetBytes("Testing")));
    authPacket.SetAttribute(new VendorSpecificAttribute(10135, 2, new[] { (byte)7 }));
    RadiusPacket receivedPacket = await rc.SendAndReceivePacket(authPacket);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-27
      • 2022-01-09
      • 1970-01-01
      • 1970-01-01
      • 2017-02-21
      • 2020-07-11
      • 2018-07-01
      • 1970-01-01
      相关资源
      最近更新 更多