summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/StreamStack')
-rw-r--r--Swiften/StreamStack/TLSLayer.cpp8
-rw-r--r--Swiften/StreamStack/TLSLayer.h13
2 files changed, 17 insertions, 4 deletions
diff --git a/Swiften/StreamStack/TLSLayer.cpp b/Swiften/StreamStack/TLSLayer.cpp
index 99154f6..dd6660f 100644
--- a/Swiften/StreamStack/TLSLayer.cpp
+++ b/Swiften/StreamStack/TLSLayer.cpp
@@ -38,4 +38,12 @@ bool TLSLayer::setClientCertificate(const PKCS12Certificate& certificate) {
return context->setClientCertificate(certificate);
}
+Certificate::ref TLSLayer::getPeerCertificate() const {
+ return context->getPeerCertificate();
+}
+
+boost::optional<CertificateVerificationError> TLSLayer::getPeerCertificateVerificationError() const {
+ return context->getPeerCertificateVerificationError();
+}
+
}
diff --git a/Swiften/StreamStack/TLSLayer.h b/Swiften/StreamStack/TLSLayer.h
index f8cda41..6fb825f 100644
--- a/Swiften/StreamStack/TLSLayer.h
+++ b/Swiften/StreamStack/TLSLayer.h
@@ -8,6 +8,8 @@
#include "Swiften/Base/ByteArray.h"
#include "Swiften/StreamStack/StreamLayer.h"
+#include "Swiften/TLS/Certificate.h"
+#include "Swiften/TLS/CertificateVerificationError.h"
namespace Swift {
class TLSContext;
@@ -19,11 +21,14 @@ namespace Swift {
TLSLayer(TLSContextFactory*);
~TLSLayer();
- virtual void connect();
- virtual bool setClientCertificate(const PKCS12Certificate&);
+ void connect();
+ bool setClientCertificate(const PKCS12Certificate&);
- virtual void writeData(const ByteArray& data);
- virtual void handleDataRead(const ByteArray& data);
+ Certificate::ref getPeerCertificate() const;
+ boost::optional<CertificateVerificationError> getPeerCertificateVerificationError() const;
+
+ void writeData(const ByteArray& data);
+ void handleDataRead(const ByteArray& data);
public:
boost::signal<void ()> onError;