Comments (44)
tls is all about open connections and negotiate then encrypt. It has to happen in the beginning, that makes it very hard to do some 'just plug it in'. Why not wait a while for net core 2.0. I am going to do it one way or another.
from netuv.
I plan to branch up and try plain ssl stream very soon.
from netuv.
Libuv by itself does not implement ssl, however, there are few libuv-ssl packages using open ssl packages. They all have pros and cons, I have not quite decided what to port over yet. That been said, ssl definitely is going to come at some point. My development cycle at the moment is waiting for net core 2.0 first then go from there.
from netuv.
I will give net core 2.0 ssl stream a shot before looking into other solutions.
from netuv.
from netuv.
You mean establishing connection in ssl, then let libuv take over?
from netuv.
from netuv.
The way you describing is exactly what .net core 2.0 pipeline is supposed to do. That was one the reasons I am waiting for it. Meanwhile, net core 2.0 also has the latest libuv 1.10. I suppose we just have to wait for a bit stable realease of net core 2.0. It is too early to do anything now, some of the spec are constantly changing at the moment.
from netuv.
from netuv.
Put it this way, basically you have to give up buffer management to bring in ssl stream, which is kind of defeating the purpose of buffer pooling. It is doable now but not ideal.
from netuv.
.net core 2.0 has pipeline which solves this problem in a much more elegant way.
from netuv.
from netuv.
It is not that far away, it is preview2 now, release is in autumn, about 2 - 3 month. pipeline only available in 2.0. I have been watching that for months now.
from netuv.
from netuv.
Think i found what you are waiting on. It is System.IO.Pipelines.Networking.Libuv right? https://github.com/dotnet/corefxlab/tree/master/src/System.IO.Pipelines.Networking.Libuv
from netuv.
That one is experimental and internally used by kestrel server with libuv tcp handle.
from netuv.
Is there another one somewhere else that you were talking about? Can you provide a link. In my case it is just a personal project for improving my systems at home but the client connections it makes out to the internet must be SSL so was thinking to keep the server using your lib as that works really well but maybe write the client to use what you were talking about in coming in core 2 so i could even use the preview version for now if i need to go that far as your libs will hopefully run on it.
from netuv.
Mainly released version of https://github.com/dotnet/corefxlab/tree/master/src/System.IO.Pipelines
It is not that simple to convert, requires fair bit of work to fit in.
from netuv.
ok but is it even a part of core2? I did find https://dotnet.myget.org/feed/dotnet-corefxlab/package/nuget/System.IO.Pipelines.Networking.Libuv and standard pipelines is there as well and they only seem to need .NETStandard 1.3 so i may just need to add a new nuget server. I would need to adjust my client code a little as well as work out how to connect up the ssl still in the client
from netuv.
The corefxlab libuv pipeline does not support tls.
from netuv.
You have to build everything from scratch. But with the pipelining, it is much easier.
from netuv.
I think i get it. I would need to create a class that does basically the same thing as SSLStream but over an IPipeConnection and it needs to implement that interface as well so i can put it inline. Using a StreamPipeConnection may make it easier as well. Hopefully this will not be too hard but last time i had rip apart SSLStream to support selecting ssl certificate based on hostname it was a bit of a pain.
from netuv.
Most of the implementations relying on new classes such as span, memory buffers. Too much of dependencies to pull over individually.
from netuv.
from netuv.
Please let me know how it goes. I plan to do this once net core 2 going into a reasonably stable state I can start over with new classes.
from netuv.
from netuv.
First tip if you want to use System.IO.Pipelines.Networking.Libuv you actually need to add 2 nuget repositories to get everything to install in current version of dotnet in netstandard 1.3 library.
For piplines etc
https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json
for dependancies
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
i will let you know how i go once i build my client with ssl
from netuv.
pipelines are very similar to normal sockets but just a little harder to use. One of the major downsides i found at the minute is the nuget package published and the samples checked in wont work together. methods have changed so it may not be usable yet sadly. I thought they were just tweaking implementations but this is core things like reading the data that seems to have changed as far as i can tell.
from netuv.
That one intensively use new io memory namespace and new span which is not available yet (only in net core 2.0). That is the reason I am waiting at the moment. The nightly packages tend to change a lot. Not something you can reliably code against.
from netuv.
from netuv.
from netuv.
@StormHub Out of curiosity. Do you have a rough idea how to implement this now that .Net Core 2.0 is out?
from netuv.
NetUV is going to stay on net standard 1.6 for quite some time. There are few options for ssl, for instance
https://github.com/Drawaes/Leto
Or open to the libuv approach, see
libuv/libuv#1128
from netuv.
Another option will be managed ssl stream from .net. I haven't completely made my mind yet.
from netuv.
from netuv.
Tls will be added for sure. The question is SslStream or openSsl at the moment.
from netuv.
from netuv.
SslStream is not quite there yet.
see https://github.com/aspnet/KestrelHttpServer/tree/dev/src/Kestrel.Tls
from netuv.
@StormHub And update on this? I need to support TLS pretty soon and right now none the options discussed in this thread sound relatively painless. 😅
from netuv.
@StormHub Would be nice if you could keep us updated on this
from netuv.
from netuv.
Well, I will try sslstream first and see how it goes
from netuv.
Is this still on the roadmap? :)
from netuv.
@oliverw I am not sure when to jump on 2.0 at the moment :)
from netuv.
Related Issues (20)
- libuv version on linux HOT 8
- Cause NullReferenceException in EventLoop HOT 14
- Question about ReadableBuffer.ReadString with separator HOT 2
- IndexOutOfRangeException occurred in Readbytes HOT 2
- How to consume data HOT 8
- How to get a callback on server when client disconnect HOT 4
- Multiple loops and threads HOT 10
- When to Dispose Async HOT 2
- System.NullReferenceException In WriteRequest.Release() HOT 7
- System.AccessViolationException In StreamHandle.WriteStream HOT 4
- SegFault on Linux when server actively terminates client connection HOT 57
- Support websocket HOT 1
- update libuv v1.19.1? HOT 1
- how can i use multi event loop? HOT 4
- Can I join you? HOT 1
- can you give a performance and stable test HOT 1
- sir,you should update your prj to v2.1 HOT 4
- Support .NET Core 2.1 new memory primitives like Memory<T> and Span<T> HOT 1
- 怎么才能正确使用 HOT 5
- OnError never called HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netuv.