This project is read-only.

can't connect to ikev2 VPN under win7 64bit(I'm using account/password authentication)

Jun 15, 2013 at 1:30 PM
It works without any problem under Win8 64 bit.

But it throws an Error 1931 under win7 64bit, it looks like connection time out(?)

The VPN dial entry was created by dotras,

and I don't have any problem with connecting the vpn server with the windows's dialer,

but once I use dotras to dial, it returns Error 1931.

I'm using version 1.3RC2 .net4.0
Jun 15, 2013 at 2:42 PM
I must say this is the first time I've ever heard of this problem. Couple questions to get us started:

1) Does it work on Windows 7 32-bit?
2) Could you post some code how you're using DotRas to dial the connection? Specifically, I need to see how you're using the RasDialer to initiate the connection, and whether you're dialing synchronously or asynchronously. Along with any options you may be passing to the dialer that is not stored in the entry.

According to the WinError.h file, the 1931 error you're experiencing is ERROR_CONTEXT_EXPIRED whose description is "The context has expired and can no longer be used."
Jun 17, 2013 at 11:26 AM
1) no..

2)
            VPNDEVICE = RasDevice.GetDeviceByName("(IKEV2)", RasDeviceType.Vpn, false);
            VPNTYPE = RasVpnStrategy.IkeV2Only;

            this.dialer = new RasDialer();
            this.dialer.PhoneBookPath = RasPhoneBook.GetPhoneBookPath(RasPhoneBookType.AllUsers);
            RasEntry vpn = RasEntry.CreateVpnEntry("Test", IPaddr, VPNTYPE, VPNDEVICE);
            phonebook.Entries.Add(vpn);

        try
        {   
            this.dialer.EntryName = "Test";
            this.dialer.Credentials = new System.Net.NetworkCredential(VPN.Instance.username, VPN.Instance.password);
            this.handle = this.dialer.DialAsync();

        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
i also can share you my VPN account for test this issue.

thanks
Jun 18, 2013 at 1:24 AM
Nothing looks out of the ordinary that would cause problems, what kind of VPN server are you connecting to?
Jun 18, 2013 at 4:31 AM
I m currently using strongSwan to authenticate VPN client...
Jun 18, 2013 at 2:03 PM
Most likely that's what the problem is then. I've seen similar issues with disconnecting from Linux based VPN servers a couple years ago, it all depends on the VPN server implementation.

Try dialing the connection synchronously and see if the problem persists. Just change your DialAsync call to Dial to do so, keep in mind that you'll lose your events... I'm just trying to narrow down where the problem might be.
Jun 19, 2013 at 2:48 PM
jeff_winn wrote:
Most likely that's what the problem is then. I've seen similar issues with disconnecting from Linux based VPN servers a couple years ago, it all depends on the VPN server implementation.

Try dialing the connection synchronously and see if the problem persists. Just change your DialAsync call to Dial to do so, keep in mind that you'll lose your events... I'm just trying to narrow down where the problem might be.
It's still not working,here is the error.

http://postimg.org/image/x0vlq56mh/
Jun 19, 2013 at 10:50 PM
I know this might sound a bit strange, but try to dial the connection using the rasdial.exe console application that's included with Windows. If it works there, it's most likely a problem with DotRas, though I have no idea how I'm going to fix it.
Jun 20, 2013 at 3:10 AM
Edited Jun 20, 2013 at 4:30 AM
here is the log..

C:\Windows\system32>rasdial.exe "Test"
Connecting to Test...
Verifying username and password...
Registering your computer on the network...
Successfully connected to Test.
Command completed successfully.
Jun 20, 2013 at 4:35 AM
Hmmm, I might have an idea what's causing it. Going to need you to go grab the source code to make the necessary modifications as I'm probably not going to be able to replicate the issue here.

Pull the source code, go to $/Branches/1.3/Source/DotRas/DotRas/Internal/RasHelper.cs and comment the following lines in the Dial method:
186       if (lpRasDialParams != IntPtr.Zero)
187       {
188           Marshal.FreeHGlobal(lpRasDialParams);
189       }

194       if (lpRasDialExtensions != IntPtr.Zero)
195       {
196           Marshal.FreeHGlobal(lpRasDialExtensions);
197       }
This will cause a memory leak, but for isolation purposes I think it's a good idea to test it. You'll need to change the project conditional compilation symbol from WIN8 to WIN7 for that build to test with.
Jun 20, 2013 at 7:09 AM
Hello,

I have tried this build, but still not work for me...

still got error 1931
Jun 20, 2013 at 2:03 PM
I created a work item for it, though I'm not sure what all I'm going to be able to do to fix it. I'll spend a bit more time on it, but you're the first person to ask about this particular VPN in the past 5 years.

Head to the work item here for further resolution.
Aug 14, 2013 at 5:34 AM
hello,

today i have tested ikev2 on windows7 32-bit , it worked for me !

but 64-bit is still not working.
Sep 17, 2013 at 10:59 PM
already run on windows 7 64?
Sep 18, 2013 at 12:00 AM
Edited Sep 18, 2013 at 12:00 AM
Yah have a issue with Windows 7 64, the problem is not in entrybook i try connect doing twice click on file and work but if use the same with DotRas 1.3 dont work.
Solution ?
Thanks.
I appreciate DotRas good job Developer ...