UWP VPN - VpnPlugin connect implementation throws exception in StartWithMainTransportdetecting a VPN connection in Windows?Establish a VPN connection in cmdCheckpoint VPN issue: Connectivity with VPN service is lostCarouselPanel in UWP throwing exceptionConnecting to VPN stops UWP apps internet communicationCreating a VPN connection in PowerShellHow can I set the endpoint of a VPN Native Plugin in UWP?UWP create VPN connectionUWP, VPN authentication with app container certificatesHow to connect to the MS-SSTP VPN server from C# UWP application?

Biological Blimps: Propulsion

How should I respond when I lied about my education and the company finds out through background check?

A social experiment. What is the worst that can happen?

How do I color the graph in datavisualization?

WiFi Thermostat, No C Terminal on Furnace

How to explain what's wrong with this application of the chain rule?

Is it better practice to read straight from sheet music rather than memorize it?

Delivering sarcasm

Why did the EU agree to delay the Brexit deadline?

Create all possible words using a set or letters

Which one is correct as adjective “protruding” or “protruded”?

Count the occurrence of each unique word in the file

Where did Heinlein say "Once you get to Earth orbit, you're halfway to anywhere in the Solar System"?

Is there a working SACD iso player for Ubuntu?

What is Cash Advance APR?

Closed-form expression for certain product

What was the exact wording from Ivanhoe of this advice on how to free yourself from slavery?

Lowest total scrabble score

Argument list too long when zipping large list of certain files in a folder

Strong empirical falsification of quantum mechanics based on vacuum energy density

Loading commands from file

On a tidally locked planet, would time be quantized?

What is the evidence for the "tyranny of the majority problem" in a direct democracy context?

Should I outline or discovery write my stories?



UWP VPN - VpnPlugin connect implementation throws exception in StartWithMainTransport


detecting a VPN connection in Windows?Establish a VPN connection in cmdCheckpoint VPN issue: Connectivity with VPN service is lostCarouselPanel in UWP throwing exceptionConnecting to VPN stops UWP apps internet communicationCreating a VPN connection in PowerShellHow can I set the endpoint of a VPN Native Plugin in UWP?UWP create VPN connectionUWP, VPN authentication with app container certificatesHow to connect to the MS-SSTP VPN server from C# UWP application?













0















Kindly see the UWP code snippet below tried on Windows 10 desktop using Visual Studio 2017 community edition.



The code implements Custom IVpnPlugin module. When system's VPN configuration is selected to this app and connect is done, the application's task gets triggered and VPN plugin's "Connect()" method gets invoked.



However, following code steps face exception while executing StartWithMainTransport(…).
("The operation was cancelled by user") on Visual Studio.
On the system's VPN settings following error is seen - "remote access service ip configuration is unusable"



I think I am passing correctly v4 and v6 address to the channel->StartWithMainTransport(…) API which are bound to my m/c network I/f. What other validations may have caused this issue. I do not want to configure certificates etc for the VpnChannel as I plan to implement encapsulate and decapsulate myself in VpnPlugin.



// Sample Plugin's connect implementation 
void TunnelPlugin::Connect(Windows::Networking::Vpn::VpnChannel^ channel)

this->dSock = ref new DatagramSocket();
channel->AssociateTransport(this->dSock, nullptr); // No difference even if this statement is moved after ConnectAsync().
Platform::String^ svcName = "22111";
auto result = create_task(dSock->BindServiceNameAsync(svcName));
result.get();
// Connect to the destination tunnel address on UDP socket.
HostName^ remoteTunnelIP = ref new HostName("192.168.1.137");
Platform::String^ remoteTunnelPort = "22112";
result = create_task(this->dSock->ConnectAsync(remoteTunnelIP, remoteTunnelPort));
result.get();

VpnChannelConfiguration^ chanCfg = channel->Configuration;
// IP destinations to be routed via VPN
VpnRouteAssignment^ routeScope = ref new VpnRouteAssignment();
routeScope->Ipv4InclusionRoutes->Append(ref new VpnRoute(ref new HostName("192.168.1.111"), 32));
Vector<HostName^>^ localV4Addrs = ref new Vector<HostName^>;
localV4Addrs->Append(ref new HostName("192.168.1.133")); // Local host name to be bound.
Vector<HostName^>^ localV6Addrs = ref new Vector<HostName^>;
localV6Addrs->Append(ref new HostName("fc00::44fd:d3ed:b02a:a05e"));
Vector<HostName^>^ dnsServers = ref new Vector<HostName^>;
dnsServers->Append(ref new HostName("1.1.1.1"));
VpnDomainNameInfo^ dnsInfo = ref new VpnDomainNameInfo(".", VpnDomainNameType::Suffix, dnsServers, ref new Vector<HostName^>);
VpnDomainNameAssignment^ dnsAssignment = ref new VpnDomainNameAssignment;
dnsAssignment->DomainNameList->Append(dnsInfo);

try

// Throws exception here.
channel->StartWithMainTransport(localV4Addrs->GetView(), localV6Addrs->GetView(), nullptr, routeScope, dnsAssignment, 1400, 1412, false, this->dSock);

catch (Exception^ exc)

auto type = exc->GetType();
Platform::String^ str = exc->ToString();











share|improve this question







New contributor




default s is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    0















    Kindly see the UWP code snippet below tried on Windows 10 desktop using Visual Studio 2017 community edition.



    The code implements Custom IVpnPlugin module. When system's VPN configuration is selected to this app and connect is done, the application's task gets triggered and VPN plugin's "Connect()" method gets invoked.



    However, following code steps face exception while executing StartWithMainTransport(…).
    ("The operation was cancelled by user") on Visual Studio.
    On the system's VPN settings following error is seen - "remote access service ip configuration is unusable"



    I think I am passing correctly v4 and v6 address to the channel->StartWithMainTransport(…) API which are bound to my m/c network I/f. What other validations may have caused this issue. I do not want to configure certificates etc for the VpnChannel as I plan to implement encapsulate and decapsulate myself in VpnPlugin.



    // Sample Plugin's connect implementation 
    void TunnelPlugin::Connect(Windows::Networking::Vpn::VpnChannel^ channel)

    this->dSock = ref new DatagramSocket();
    channel->AssociateTransport(this->dSock, nullptr); // No difference even if this statement is moved after ConnectAsync().
    Platform::String^ svcName = "22111";
    auto result = create_task(dSock->BindServiceNameAsync(svcName));
    result.get();
    // Connect to the destination tunnel address on UDP socket.
    HostName^ remoteTunnelIP = ref new HostName("192.168.1.137");
    Platform::String^ remoteTunnelPort = "22112";
    result = create_task(this->dSock->ConnectAsync(remoteTunnelIP, remoteTunnelPort));
    result.get();

    VpnChannelConfiguration^ chanCfg = channel->Configuration;
    // IP destinations to be routed via VPN
    VpnRouteAssignment^ routeScope = ref new VpnRouteAssignment();
    routeScope->Ipv4InclusionRoutes->Append(ref new VpnRoute(ref new HostName("192.168.1.111"), 32));
    Vector<HostName^>^ localV4Addrs = ref new Vector<HostName^>;
    localV4Addrs->Append(ref new HostName("192.168.1.133")); // Local host name to be bound.
    Vector<HostName^>^ localV6Addrs = ref new Vector<HostName^>;
    localV6Addrs->Append(ref new HostName("fc00::44fd:d3ed:b02a:a05e"));
    Vector<HostName^>^ dnsServers = ref new Vector<HostName^>;
    dnsServers->Append(ref new HostName("1.1.1.1"));
    VpnDomainNameInfo^ dnsInfo = ref new VpnDomainNameInfo(".", VpnDomainNameType::Suffix, dnsServers, ref new Vector<HostName^>);
    VpnDomainNameAssignment^ dnsAssignment = ref new VpnDomainNameAssignment;
    dnsAssignment->DomainNameList->Append(dnsInfo);

    try

    // Throws exception here.
    channel->StartWithMainTransport(localV4Addrs->GetView(), localV6Addrs->GetView(), nullptr, routeScope, dnsAssignment, 1400, 1412, false, this->dSock);

    catch (Exception^ exc)

    auto type = exc->GetType();
    Platform::String^ str = exc->ToString();











    share|improve this question







    New contributor




    default s is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      0












      0








      0








      Kindly see the UWP code snippet below tried on Windows 10 desktop using Visual Studio 2017 community edition.



      The code implements Custom IVpnPlugin module. When system's VPN configuration is selected to this app and connect is done, the application's task gets triggered and VPN plugin's "Connect()" method gets invoked.



      However, following code steps face exception while executing StartWithMainTransport(…).
      ("The operation was cancelled by user") on Visual Studio.
      On the system's VPN settings following error is seen - "remote access service ip configuration is unusable"



      I think I am passing correctly v4 and v6 address to the channel->StartWithMainTransport(…) API which are bound to my m/c network I/f. What other validations may have caused this issue. I do not want to configure certificates etc for the VpnChannel as I plan to implement encapsulate and decapsulate myself in VpnPlugin.



      // Sample Plugin's connect implementation 
      void TunnelPlugin::Connect(Windows::Networking::Vpn::VpnChannel^ channel)

      this->dSock = ref new DatagramSocket();
      channel->AssociateTransport(this->dSock, nullptr); // No difference even if this statement is moved after ConnectAsync().
      Platform::String^ svcName = "22111";
      auto result = create_task(dSock->BindServiceNameAsync(svcName));
      result.get();
      // Connect to the destination tunnel address on UDP socket.
      HostName^ remoteTunnelIP = ref new HostName("192.168.1.137");
      Platform::String^ remoteTunnelPort = "22112";
      result = create_task(this->dSock->ConnectAsync(remoteTunnelIP, remoteTunnelPort));
      result.get();

      VpnChannelConfiguration^ chanCfg = channel->Configuration;
      // IP destinations to be routed via VPN
      VpnRouteAssignment^ routeScope = ref new VpnRouteAssignment();
      routeScope->Ipv4InclusionRoutes->Append(ref new VpnRoute(ref new HostName("192.168.1.111"), 32));
      Vector<HostName^>^ localV4Addrs = ref new Vector<HostName^>;
      localV4Addrs->Append(ref new HostName("192.168.1.133")); // Local host name to be bound.
      Vector<HostName^>^ localV6Addrs = ref new Vector<HostName^>;
      localV6Addrs->Append(ref new HostName("fc00::44fd:d3ed:b02a:a05e"));
      Vector<HostName^>^ dnsServers = ref new Vector<HostName^>;
      dnsServers->Append(ref new HostName("1.1.1.1"));
      VpnDomainNameInfo^ dnsInfo = ref new VpnDomainNameInfo(".", VpnDomainNameType::Suffix, dnsServers, ref new Vector<HostName^>);
      VpnDomainNameAssignment^ dnsAssignment = ref new VpnDomainNameAssignment;
      dnsAssignment->DomainNameList->Append(dnsInfo);

      try

      // Throws exception here.
      channel->StartWithMainTransport(localV4Addrs->GetView(), localV6Addrs->GetView(), nullptr, routeScope, dnsAssignment, 1400, 1412, false, this->dSock);

      catch (Exception^ exc)

      auto type = exc->GetType();
      Platform::String^ str = exc->ToString();











      share|improve this question







      New contributor




      default s is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Kindly see the UWP code snippet below tried on Windows 10 desktop using Visual Studio 2017 community edition.



      The code implements Custom IVpnPlugin module. When system's VPN configuration is selected to this app and connect is done, the application's task gets triggered and VPN plugin's "Connect()" method gets invoked.



      However, following code steps face exception while executing StartWithMainTransport(…).
      ("The operation was cancelled by user") on Visual Studio.
      On the system's VPN settings following error is seen - "remote access service ip configuration is unusable"



      I think I am passing correctly v4 and v6 address to the channel->StartWithMainTransport(…) API which are bound to my m/c network I/f. What other validations may have caused this issue. I do not want to configure certificates etc for the VpnChannel as I plan to implement encapsulate and decapsulate myself in VpnPlugin.



      // Sample Plugin's connect implementation 
      void TunnelPlugin::Connect(Windows::Networking::Vpn::VpnChannel^ channel)

      this->dSock = ref new DatagramSocket();
      channel->AssociateTransport(this->dSock, nullptr); // No difference even if this statement is moved after ConnectAsync().
      Platform::String^ svcName = "22111";
      auto result = create_task(dSock->BindServiceNameAsync(svcName));
      result.get();
      // Connect to the destination tunnel address on UDP socket.
      HostName^ remoteTunnelIP = ref new HostName("192.168.1.137");
      Platform::String^ remoteTunnelPort = "22112";
      result = create_task(this->dSock->ConnectAsync(remoteTunnelIP, remoteTunnelPort));
      result.get();

      VpnChannelConfiguration^ chanCfg = channel->Configuration;
      // IP destinations to be routed via VPN
      VpnRouteAssignment^ routeScope = ref new VpnRouteAssignment();
      routeScope->Ipv4InclusionRoutes->Append(ref new VpnRoute(ref new HostName("192.168.1.111"), 32));
      Vector<HostName^>^ localV4Addrs = ref new Vector<HostName^>;
      localV4Addrs->Append(ref new HostName("192.168.1.133")); // Local host name to be bound.
      Vector<HostName^>^ localV6Addrs = ref new Vector<HostName^>;
      localV6Addrs->Append(ref new HostName("fc00::44fd:d3ed:b02a:a05e"));
      Vector<HostName^>^ dnsServers = ref new Vector<HostName^>;
      dnsServers->Append(ref new HostName("1.1.1.1"));
      VpnDomainNameInfo^ dnsInfo = ref new VpnDomainNameInfo(".", VpnDomainNameType::Suffix, dnsServers, ref new Vector<HostName^>);
      VpnDomainNameAssignment^ dnsAssignment = ref new VpnDomainNameAssignment;
      dnsAssignment->DomainNameList->Append(dnsInfo);

      try

      // Throws exception here.
      channel->StartWithMainTransport(localV4Addrs->GetView(), localV6Addrs->GetView(), nullptr, routeScope, dnsAssignment, 1400, 1412, false, this->dSock);

      catch (Exception^ exc)

      auto type = exc->GetType();
      Platform::String^ str = exc->ToString();








      windows uwp vpn






      share|improve this question







      New contributor




      default s is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      default s is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      default s is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 days ago









      default sdefault s

      11




      11




      New contributor




      default s is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      default s is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      default s is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          default s is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55281362%2fuwp-vpn-vpnplugin-connect-implementation-throws-exception-in-startwithmaintran%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          default s is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          default s is a new contributor. Be nice, and check out our Code of Conduct.












          default s is a new contributor. Be nice, and check out our Code of Conduct.











          default s is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55281362%2fuwp-vpn-vpnplugin-connect-implementation-throws-exception-in-startwithmaintran%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현