summaryrefslogtreecommitdiffstats
path: root/src/PolarSSL++/BlockingSslClientSocket.cpp
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
commit6fdd7194c81be7234a126bdc3b48f0291fce3567 (patch)
tree7d5ac74b7385ce4ebf77588d80549c884c2b993c /src/PolarSSL++/BlockingSslClientSocket.cpp
parentMerge pull request #2958 from LogicParrot/fence (diff)
parentBulk clearing of whitespace (diff)
downloadcuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.gz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.bz2
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.lz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.xz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.zst
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.zip
Diffstat (limited to '')
-rw-r--r--src/PolarSSL++/BlockingSslClientSocket.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/PolarSSL++/BlockingSslClientSocket.cpp b/src/PolarSSL++/BlockingSslClientSocket.cpp
index 61aee211d..7d7fc4ccf 100644
--- a/src/PolarSSL++/BlockingSslClientSocket.cpp
+++ b/src/PolarSSL++/BlockingSslClientSocket.cpp
@@ -106,7 +106,7 @@ bool cBlockingSslClientSocket::Connect(const AString & a_ServerName, UInt16 a_Po
m_LastErrorText = "Already connected";
return false;
}
-
+
// Connect the underlying socket:
m_ServerName = a_ServerName;
if (!cNetwork::Connect(a_ServerName, a_Port,
@@ -123,7 +123,7 @@ bool cBlockingSslClientSocket::Connect(const AString & a_ServerName, UInt16 a_Po
{
return false;
}
-
+
// Initialize the SSL:
int ret = m_Ssl.Initialize(true);
if (ret != 0)
@@ -131,20 +131,20 @@ bool cBlockingSslClientSocket::Connect(const AString & a_ServerName, UInt16 a_Po
Printf(m_LastErrorText, "SSL initialization failed: -0x%x", -ret);
return false;
}
-
+
// If we have been assigned a trusted CA root cert store, push it into the SSL context:
if (m_CACerts.get() != nullptr)
{
m_Ssl.SetCACerts(m_CACerts, m_ExpectedPeerName);
}
-
+
ret = m_Ssl.Handshake();
if (ret != 0)
{
Printf(m_LastErrorText, "SSL handshake failed: -0x%x", -ret);
return false;
}
-
+
return true;
}
@@ -163,7 +163,7 @@ bool cBlockingSslClientSocket::SetTrustedRootCertsFromString(const AString & a_C
a_ExpectedPeerName.c_str()
);
}
-
+
// Parse the cert:
m_CACerts.reset(new cX509Cert);
int ret = m_CACerts->Parse(a_CACerts.data(), a_CACerts.size());
@@ -173,7 +173,7 @@ bool cBlockingSslClientSocket::SetTrustedRootCertsFromString(const AString & a_C
return false;
}
m_ExpectedPeerName = a_ExpectedPeerName;
-
+
return true;
}
@@ -188,7 +188,7 @@ bool cBlockingSslClientSocket::Send(const void * a_Data, size_t a_NumBytes)
m_LastErrorText = "Socket is closed";
return false;
}
-
+
// Keep sending the data until all of it is sent:
const char * Data = reinterpret_cast<const char *>(a_Data);
size_t NumBytes = a_NumBytes;
@@ -241,7 +241,7 @@ void cBlockingSslClientSocket::Disconnect(void)
{
return;
}
-
+
m_Ssl.NotifyClose();
m_IsConnected = false;