Commit Graph

1328 Commits

Author SHA1 Message Date
Marko Lalic be674a28e0 openssl: Advertise NPN protocols for server sockets
If a server socket is created with a context on which the
`set_npn_protocols` method has been called, during TLS connection
establishment, the server will advertise the list of protocols given to
the method, in case the client indicates that it supports the NPN TLS
extension.
2015-03-23 08:41:15 +01:00
Marko Lalic 8931299eab openssl: Add methods to get the protocol selected by NPN
The method is added to the `Ssl` struct, since this is how the native
OpenSSL API works. It is also added to the `SslStream` convenience
struct, since the `Ssl` instance that it wraps is not public and clients
may want to check which protocol is in use on a particular SSL stream.
2015-03-23 08:41:15 +01:00
Marko Lalic 5689ad9260 openssl: Implement client-side NPN protocol selection
After the `set_npn_protocols` method of the `SslContext` struct is
called, any future TLS connections established with this context will
perform NPN negotiation.

The chosen protocol is the one with the highest priority in the
server's protocol list that is also in the client's protocol list.
(This is the default behavior provided by OpenSSL's
`SSL_select_next_proto` function.)

If there is no overlap between the two lists, no error is raised.
2015-03-23 08:41:15 +01:00
Marko Lalic 83c279013b openssl: Add method for setting protocols to be used in NPN
A new method `set_npn_protocols` is added to the `SslContext` struct,
when the `npn` feature is enabled.

The method takes a list of protocols that are supported by the peer.
These protocols will be used during Next Protocol Negotiation.

The method saves the given list within the extra data of the OpenSSL
Context structure, so that the list can be referred to later on by the
callbacks invoked during TLS connection establishment.
2015-03-23 08:41:15 +01:00
Steven Fackler 20335c4f00 Merge pull request #187 from manuels/x509_sign
Add X509Generator::sign()
2015-03-21 13:53:25 -04:00
Manuel Schölling 6373b96924 Add X509Generator::sign() 2015-03-21 18:02:29 +01:00
Steven Fackler b406b7c6e6 Fix doc test 2015-03-21 10:00:00 -07:00
Steven Fackler ac24bc5422 Fix warnings and build issues 2015-03-20 08:33:42 -07:00
Steven Fackler a65b03c89e Fix warnings 2015-03-10 19:38:44 -07:00
Steven Fackler 8b8736fb46 Merge pull request #172 from reaperhulk/add-ssl-ctx-set-get-options
add support for SSL_CTX_set_options and SSL_CTX_get_options
2015-03-07 08:43:30 -08:00
Aaron Weiss c3eee3b194 Added try_clone to SslStream for SslStream<TcpStream>. 2015-03-02 16:32:25 -05:00
Steven Fackler 2789764fe3 Merge branch 'breaks'
Conflicts:
	openssl/src/lib.rs
2015-02-27 19:47:24 -08:00
Steven Fackler 14e6b1b530 Silence stability warning 2015-02-26 09:02:16 -08:00
Steven Fackler 6991cc6a30 Convert to new IO. 2015-02-24 23:01:57 -08:00
Steven Fackler 1b4a2eef0e Switch to cargo liblibc 2015-02-24 21:47:30 -08:00
Paul Kehrer 8940bd767b add support for SSL_CTX_clear_options and use bitflags 2015-02-23 19:39:23 -06:00
Paul Kehrer 06ba41ad47 add support for SSL_CTX_set_options and SSL_CTX_get_options
fixes #168
2015-02-22 15:45:00 -06:00
Steven Fackler 69e371aafd Remove old attributes 2015-02-21 16:48:32 -08:00
Kevin Butler cb0e1688c8 Update depreciated code 2015-02-20 21:04:01 +00:00
Kevin Butler 00e4941a75 Unique<T> now derefs to *mut T 2015-02-20 20:43:07 +00:00
Steven Fackler 6bfc4d986b Fix warnings 2015-02-19 09:13:22 -08:00
Steven Fackler 4e83bebb4b Rename method for clarity 2015-02-16 23:28:47 -08:00
Steven Fackler e52d02171b Properly handle errors in write 2015-02-16 22:38:34 -08:00
Steven Fackler f0eb8e39e3 Deal with openssl errors in read
I'm not sure of a great way to generate this case in a test,
unfortunately.

Closes #157
2015-02-16 22:21:13 -08:00
Steven Fackler 2fa1571e2e Remove deprecated functions from openssl-sys 2015-02-13 23:31:00 -08:00
Robin Gloster fabc1da31e rustup to current master 2015-02-12 18:25:45 +01:00
Steven Fackler 6ef819f971 Fix builds against 0.9.x OpenSSL
Namely builds on OSX
2015-02-08 23:31:46 -08:00
Steven Fackler ec65b0c67b Move docs to this repo and auto build 2015-02-07 21:30:05 -08:00