Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi tultalk:

I don't know specifically what these three example communications are: C: <starts TLS negotiation> C & S: <negotiate a TLS session> C & S: <check result of negotiation>

This part would do a public key exchange and negotiate a private key for this session. After this step all data going to the server must be encrypted by openssl before sending, and all data coming from the server must be decrypted by openssl before it is usable

The IO::Socket::SSL has an example of how to upgrade a socket from plain to SSL, assuming you are using IO::Socket::INET as the base socket. Search for "Talk Plain and SSL With The Same Socket" in the docs. I haven't looked at the code it uses, but I'm assuming that it re-blesses the socket into IO::Socket::SSL, and after that the IO::Socket::SSL module will encrypt any data you write to the socket before sending to the socket, and decrypt any data it reads from the socket before giving it to you.

In the example above I didn't see any SSL modules, so I assumed you were still writing plaintext directly to the socket. If that's not the case, could you show the part that does the ssl negotiation and adds the layer to encrypt/decrypt?

If you want a learning experience, Net::SSLeay directly exposes the openssl library's low-level functions to negotiate sessions, and encrypt/decrypt data. I've never used it directly myself, but I would imagine that there are some good examples in the IO::Socket::SSL sources.


In reply to Re^3: STARTTLS Failure by jeffenstein
in thread STARTTLS Failure by tultalk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-28 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found