diff options
| author | Tim Costen <tim.costen@isode.com> | 2019-10-04 14:51:06 (GMT) |
|---|---|---|
| committer | Kevin Smith <kevin.smith@isode.com> | 2019-10-07 09:30:04 (GMT) |
| commit | 2239cdae45b39e675877ae32c86c47bcadce3090 (patch) | |
| tree | 5ee18af14ee9e9ee6f8616d352b4e808cfd95e4b /Swiften/TLS/TLSOptions.h | |
| parent | 2ad1938c50f9fe57fe3dd98eb9f4bb711ac52acd (diff) | |
| download | swift-2239cdae45b39e675877ae32c86c47bcadce3090.zip swift-2239cdae45b39e675877ae32c86c47bcadce3090.tar.bz2 | |
Add ability to set external Trust Anchors to Swift OpenSSL context
Add a new (optional) field to TLSContext, which allows a vector
of Trust Anchor certificates to be specified.
Inside OpenSSLContext::configure, pass the X509 components of
these certificates into the OpenSSL context: these are now
available for client certificate verification in any callback
method set via TLSOptions.verifyCertificateCallback.
JIRA: LINK-1765
Test-information:
Tested via MLink unit tests. No leaks reported.
Change-Id: Ie9cc2051ee212249a12a4bc71b62306b5bce3013
Diffstat (limited to 'Swiften/TLS/TLSOptions.h')
| -rw-r--r-- | Swiften/TLS/TLSOptions.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Swiften/TLS/TLSOptions.h b/Swiften/TLS/TLSOptions.h index 56648a3..4109096 100644 --- a/Swiften/TLS/TLSOptions.h +++ b/Swiften/TLS/TLSOptions.h @@ -2,18 +2,19 @@ * Copyright (c) 2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once namespace Swift { class TLSContext; + class Certificate; class TLSOptions { public: TLSOptions() : schannelTLS1_0Workaround(false) { } /** * A bug in the Windows SChannel TLS stack, combined with @@ -56,11 +57,16 @@ namespace Swift { Optional }; boost::optional<VerifyMode> verifyMode; /** * Callback for certificate verification */ boost::optional<std::function<int(const TLSContext *)>> verifyCertificateCallback; + + /** + * Allows specification of application-specific Trust Anchors + */ + boost::optional<std::vector<std::shared_ptr<Certificate>>> trustAnchors; }; } |
Swift