Giter Club home page Giter Club logo

dotras's Introduction

DotRas

Provides remote access service (RAS) components for .NET languages like C#, VB.NET, and C++ CLR projects.

Build Status Quality Gate Status Coverage

The build feed is located at: https://nuget.pkg.github.com/dotras/index.json

New ownership needed!

I need someone to take over ownership of the project before it dies. My time has been consumed with things I use and family lately, and given I haven't personally used this in years it's not really in active development anymore.

If you're interested in taking over ownership of the organization please reach out.

dotras's People

Contributors

jeff-winn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dotras's Issues

Need exception thrown specific to the wrong OS being used

Currently the Default exception policy is to throw a NotSupportedException when the OS being used isn’t compatible with the DotRas version being used.

This exception does not seem accurate as it is supported, just not on this OS version.

Suggesting to throw an OperatingSystemNotSupportedException or similar class to indicate this specific issue.

Preparing for 2.0.0 release

Because so much within the project has changed from V1 to V2 a README file needs to be included with a list of what has changed that can be displayed on installation.

This will need to display:

  • Feature differences
  • Call differences between versions of the API
  • Identifying support for Windows 10
  • Identify the project and how to request new features.
  • Identify that features will require testers if they are something I cannot build without help.

POLL: Should RasDialer and RasConnection use Dial / HangUp or Connect / Disconnect?

Between version 1.X and 2.0 there has been a significant change to the primary methods expected to be used on the public RasDialer and RasConnection classes.

RasDialer

  • Dial and DialAsync have now been renamed to Connect and ConnectAsync.
  • DialAsyncCancel has been removed in favor of using a cancellation token passed to the Connect/ConnectAsync methods (which can accommodate timeouts with a CancellationTokenSource).
  • Timeout property has been removed (for the same reason stated above).

RasConnection

  • HangUp has been renamed to Disconnect and DisconnectAsync.

They're both viable names, however between the two developers are more accustomed to seeing Connect / Disconnect throughout their other tooling, so the standard names would likely be easier to find. However, that also means 2.0 will not be backwards compatible with 1.X when upgrading.

Currently the DotRas SDK follows the Microsoft naming conventions within the Win32 RAS APIs.

Thoughts? Suggestions?

Hello

Hello Jeff,
Just noticed this repo :) Seems like you back to DotRas development. Does it mean it will be revised version of DotRas soon?
Could you disclosure some info about it? Is it will be available for public/commercial use, will it work on Win7+ and any Windows 10 versions, and do you have plans to support periodical updates/synchronize with latest Windows SDKs?

Thanks,
Maxim.

Enumerated Connection getstatus throws not support

G'day,

I've got an SSTP VPN connection and I can find it connected in enumerated connections, However the Get Status throws the following error, I had a little look, but couldn't find where the Unknown type is coming from, I'm guessing it just isn't supported at the moment.

Connection statistics works, So I'll use connected time in the mean time as that works

The endpoint type 'Unknown' is not supported.
at DotRas.Internal.Services.IPAddressConversionService.ConvertFromEndpoint(RASTUNNELENDPOINT endPoint) in C:\Repo\Expanded Libraries\DotRAS-Updated\src\DotRas\Internal\Services\IPAddressConversionService.cs:line 17
at DotRas.Internal.Services.Connections.RasGetConnectStatusService.CreateLocalIPAddress(RASCONNSTATUS rasConnStatus) in C:\Repo\Expanded Libraries\DotRAS-Updated\src\DotRas\Internal\Services\Connections\RasGetConnectStatusService.cs:line 67
at DotRas.Internal.Services.Connections.RasGetConnectStatusService.GetConnectionStatus(IRasConnection connection) in C:\Repo\Expanded Libraries\DotRAS-Updated\src\DotRas\Internal\Services\Connections\RasGetConnectStatusService.cs:line 38
at DotRas.RasConnection.GetStatus() in C:\Repo\Expanded Libraries\DotRAS-Updated\src\DotRas\RasConnection.cs:line 135

RasDialer must close connection attempt during dispose

The RasDialer currently does not cancel a connection attempt that is in progress if the class is disposed while busy.

The expected behavior would be to cancel the connection attempt in progress prior to dispose being completed as this can cause state management issues within RAS if it is not performed.

IKEv2 VPN works when dialed by Windows

There appears to be an issue with the dialer related to IKEv2 connections which are not able to dial when used by the API whereas it still works when dialed by Windows directly.

Need to monitor disconnections

The usage is quite simple. We have vpn connection with corresponding handle. Our goal is detect unexpected vpn disconnection and perform specific actions on that event.

Yes, sure, I'll test it.

Originally posted by @mogikanin in #2 (comment)

What separate WIN7, WIN8 and WIN10 configurations are for?

Hello Jeff,

I've started investigating the DotRas project today and cannot understand the build configuration separation for three different platforms.

Conditional compilation symbols are defined but apparently not used anywhere in the code.

Could you please elaborate?

Certificate not valid issue

I'm not sure if this is your scope problem or is it window's, but maybe you can answer me.

So user has to install a certificate in order to connect to some server. Let's say server host is myhost.com and it's IP is 111.111.111.111. The certificate is made to be valid for host myhost.com and when connecting to myhost.com everything works, but when connecting to host's IP 111.111.111.111 DotRas throws an error that certificate is invalid.

Is it DotRas scope issue or it's more low-level issue? Cause there is no such problem on Apple or Android.

Make sure cancellation of dial attempt can occur outside of the callback

The RasDial operation may require cancellation by hang up outside of the callback being executed by Windows.

If the target server doesn’t respond when appropriate the client could get stuck and never return. This would cause a deadlock and the consuming application to be blocked until the server responds even if a cancellation token is used with a cancellation source.

Ensure that once a dial operation has begun, cancellation can occur even if the callback does not get invoked.

This behavior should throw an OperationCanceledException as expected back to the DialAsync method on RasDialer.

Cancellation of the source will hang the attempt

Saw an issue with NordVPN that if cancellation is triggered, the connection is cancelled but the task being awaited is never returned.

Seems that there is an additional step required to transition the completion source if the token is cancelled.

Need to create/manipulate phone books

The RasPhoneBook class is currently missing and will need to be added to reach feature parity with 1.x.

However this will also require clean up as the previous API felt a little weird working with it.

  • Implement a change tracker and SaveChanges method to persist changes.
  • Try to consolidate the numerous methods exposed to use properties instead.
  • May need to leverage Castle.Core to help with proxy implementation for change tracking.

RasConnection has too many args in constructor

With the class being a touch point for most of the interactions with the connection, there will be an expectation of lots of different services available.

As such, rather than passing them all in for the one method call where they're used, it would be better to use service location to grab an instance. Any services that require a particular instance of the connection (perhaps they're stateful) would reside on the connection permanently.

RasConnection.GetStatus throws odd exception for terminated connections

After a RasConnection has been established if the connection is disrupted the exception thrown changes from a RasException (by the other methods on the class) to a Win32Exception indicating the handle is invalid.

The expected exception that is thrown should be a RasException with an error code of 668 indicating that the connection has been terminated rather than a Win32Exception with an error code of 6 indicating the handle is invalid.

Events from the OS need to be marshaled

For components which receive event notifications from the OS (like RasDialer and RasConnectionWatcher) the threads will need to be marshaled correctly back to the UI thread for the UI to update correctly.

RasConnection needs to support multi-link connections

The 1.x version has a GetSubEntryHandle method exposed on RasConnection and will need some variation added to reach feature parity.

Perhaps a RasConnectionLink class needs to be added instead to prevent direct manipulation of the handles?

Add support for PPP authentication cookie

Need to add support for PPP authentication cookies during a dialing request. This should involve the fSkipPppAuth flag on the RASDIALEXTENSIONS structure along with adding .NET based implementation of the RASDEVSPECIFICINFO structure.

Potential class name: PppAuthenticationCookie
Requires storage of a byte array of unknown size.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa377029(v=vs.85).aspx
https://docs.microsoft.com/en-us/windows/desktop/api/ras/ns-ras-tagrasdevspecificinfo

Add support for EAP based authentication

The RasDialer should be able to support EAP based authentication with custom EAP data. If basic credentials are only used, this work item does not apply.

See the RASDIALEXTENSIONS structure for the RasEapInfo.

RasDialer throws unexpected exception for bad username/password.

  • If we specify incorrect username, then RasDialer.DialAsync() throws RasException with NativeErrorCode= 691. That's correct.
  • But if we specify incorrect password, then occurs generic exception:
System.ArgumentException: The error code must be a positive value.
Parameter name: errorCode
   at DotRas.Internal.Services.ErrorHandling.RasGetErrorStringService.GetErrorString(Int32 errorCode)
   at DotRas.Internal.Policies.DefaultExceptionPolicy.Create(Int32 error)
   at DotRas.Internal.Services.Dialing.DefaultRasDialCallbackHandler.GuardErrorCodeMustBeZero(Int32 errorCode)
   at DotRas.Internal.Services.Dialing.DefaultRasDialCallbackHandler.OnCallback(IntPtr dwCallbackId, Int32 dwSubEntry, IntPtr hRasConn, UInt32 message, RasConnectionState connectionState, Int32 dwError, Int32 dwExtendedError)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at ConsoleRunner.Program.<ConnectAsync>d__8.MoveNext() 

Originally posted by @mogikanin in #2 (comment)

Add build feed indicators

The indicators should identify AppVeyor as the build setup along with SonarCloud.io for code quality analysis.

Need example to dial a connection and monitor for disconnects

Need another example which demonstrates the use of the RasDialer in conjunction with the RasConnectionWatcher to monitor for disconnects related to a specific connection.

  • Dial the connection
  • Attach the new connection to the RasConnectionWatcher
  • Start the watcher
  • Redial the connection on disconnect

Version of DotRas

@jeff-winn
Hi jeff-winn ,when I use your component DotRas ,I found many version such as DotRas.Win10 ,DotRas.Win8 ......,does that means only the special OS we can used on it?

Move examples into separate repository

The examples need to move into a separate repository rather than this one. This will ensure others can more easily contribute changes without cluttering the main repository.

Dialing via Dotras: Smartcard-Resource-Manager not running

Hi,

I have an IKEv2 RAS Entry with EAP-TLS SmartCard Authentication.
Due to testing limitations, the SmartCard is forwarded with RDP to the PC running the Software.
If I dial this entry with rasphone -d entry the SmartCard-PIN-Dialog shows up and the connection gets established after entering the PIN.

With DotRas I get an Exception that the "Smartcard-Resource-Manager is not running":
System.ComponentModel.Win32Exception (0x80004005): Der Smartcard-Ressourcen-Manager wird nicht ausgeführt

The same code and entry works locally, if I don't use a forwarded SmartCard.

I verified winscard finds the forwarded SmartCard and as mentioned above rasphone works.

Any Ideas what might be missing in DotRas that it seems not to be able to use forwarded SmartCards?

Installed Version: id="DotRas.for.Win10" version="2.0.0-preview-275" targetFramework="net472"

Thanks in Advance

RasDialService does not hang up connection on failure

Per Microsoft, calls to RasDial must be call RasHangUp when a non-zero response is returned from the API call. This call is currently missing from the RasDialService while it is being done within the DefaultRasDialCallbackHandler.

Dependency injection always issues singletons

The internal dependency injection container currently only issues out a single instance of an object for use across the entire app domain. This causes only a single instance to be usable at a time for a particular component without causing state issues.

The expected behavior of the container was to provide unique instances per type resolved rather than singletons.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.