简体   繁体   中英

Connect to remote server with secure sockets

I'm trying to connect to remote server(not my server) via sockets(not a HTTP request) with SSL(no client certificate is needed)

The client should have two threads, one thread that waits for incoming(with blocking) messages, and the second one for sending messages.

Basically I'm trying to simulate .NET C# SslStream and AuthenticateAsClient(String) with absolutely no success.

I don't understated how to wait for the server to authenticate the client before the client can send data in a secure way.

Can someone please provide some basic code, that connect -> authenticate -> read and write(with blocking)?

Looking at the HTTP.jl code one can see that it is build on MbedTLS.jl ( https://github.com/JuliaWeb/MbedTLS.jl ).

It seems that it is doing exactly what you need - there is a great example on MbedTLS.jl welcome page that shows how to open a low level SSL socket.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM