Go to the documentation of this file.
24#include <ksslconfig.h>
30#include <netinet/in.h>
31#include <sys/socket.h>
32#define crypt _openssl_crypt
33#include <openssl/ssl.h>
34#include <openssl/x509.h>
35#include <openssl/x509v3.h>
36#include <openssl/pem.h>
37#include <openssl/rand.h>
49#include <QtNetwork/QAbstractSocket>
54#warning "kssl.cc contains temporary functions! Clean up"
55#warning "kssl.cc needs to be ported to QSslSocket"
80 m_bAutoReconfig =
true;
101 if (m_cfg->useEGD() && !m_cfg->getEGDPath().isEmpty()) {
102 rc = d->kossl->RAND_egd(m_cfg->getEGDPath().toLatin1().constData());
104 kDebug(7029) <<
"KSSL: Error seeding PRNG with the EGD.";
105 else kDebug(7029) <<
"KSSL: PRNG was seeded with " << rc
106 <<
" bytes from the EGD." << endl;
107 }
else if (m_cfg->useEFile() && !m_cfg->getEGDPath().isEmpty()) {
108 rc = d->kossl->RAND_load_file(m_cfg->getEGDPath().toLatin1().constData(), -1);
110 kDebug(7029) <<
"KSSL: Error seeding PRNG with the entropy file.";
111 else kDebug(7029) <<
"KSSL: PRNG was seeded with " << rc
112 <<
" bytes from the entropy file." << endl;
121 kDebug(7029) <<
"KSSL initialize";
130 d->m_meth = d->kossl->SSLv23_client_method();
131 d->m_ctx = d->kossl->SSL_CTX_new(d->m_meth);
132 if (d->m_ctx == 0L) {
137 QString clist = m_cfg->getCipherList();
138 kDebug(7029) <<
"Cipher list: " << clist;
139 if (!clist.isEmpty())
140 d->kossl->SSL_CTX_set_cipher_list(d->m_ctx,
const_cast<char *
>(clist.toLatin1().constData()));
157 d->kossl->SSL_shutdown(d->m_ssl);
158 d->kossl->SSL_free(d->m_ssl);
162 d->kossl->SSL_CTX_free(d->m_ctx);
163 if (m_cfg->useEFile() && !m_cfg->getEGDPath().isEmpty()) {
164 d->kossl->RAND_write_file(m_cfg->getEGDPath().toLatin1().constData());
187 m_bAutoReconfig = ar;
204bool KSSL::m_bSSLWorks =
true;
206bool KSSL::m_bSSLWorks =
false;
static KOpenSSLProxy * self()
Return an instance of class KOpenSSLProxy * You cannot delete this object.
KSSLValidation
Result of the validate() call.
void setAutoReconfig(bool ar)
Enable or disable automatic reconfiguration on initialize().
bool reconfig()
Trigger a reread of KSSL configuration and reInitialize() KSSL.
bool setSettings(KSSLSettings *settings)
Set a new KSSLSettings instance as the settings.
static bool doesSSLWork()
Determine if SSL is available and works.
void close()
Close the SSL session.
bool reInitialize()
Reinitialize OpenSSL.
KSSL(bool init=true)
Construct a KSSL object.
KSSLSettings * settings()
One is built by the constructor, so this will only return a NULL pointer if you set one with setSetti...
int seedWithEGD()
This will reseed the pseudo-random number generator with the EGD (entropy gathering daemon) if the EG...
~KSSL()
Destroy this KSSL object.
bool initialize()
Initialize OpenSSL.
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
This file is part of the KDE documentation.
Documentation copyright © 1996-2026 The KDE developers.
Generated on
by
doxygen 1.16.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.