• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/kssl
 

tdeio/kssl

  • tdeio
  • kssl
kssl.cc
1 /* This file is part of the KDE project
2  *
3  * Copyright (C) 2000-2003 George Staikos <staikos@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
24 
25 // this hack provided by Malte Starostik to avoid glibc/openssl bug
26 // on some systems
27 #ifdef KSSL_HAVE_SSL
28 #include <unistd.h>
29 #include <netinet/in.h>
30 #include <sys/socket.h>
31 #define crypt _openssl_crypt
32 #include <openssl/ssl.h>
33 #include <openssl/x509.h>
34 #include <openssl/x509v3.h>
35 #include <openssl/pem.h>
36 #include <openssl/rand.h>
37 #undef crypt
38 #endif
39 
40 #include "kssl.h"
41 
42 #include <kdebug.h>
43 #include <kstandarddirs.h>
44 #include <ksock.h>
45 #include <ksockaddr.h>
46 
47 #include <kopenssl.h>
48 #include <ksslx509v3.h>
49 #include <ksslpkcs12.h>
50 #include <ksslsession.h>
51 #include <tdelocale.h>
52 #include <ksocks.h>
53 
54 #define sk_dup d->kossl->sk_dup
55 
56 class KSSLPrivate {
57 public:
58  KSSLPrivate() {
59  lastInitTLS = false;
60  kossl = KOpenSSLProxy::self();
61  session = 0L;
62  }
63 
64  ~KSSLPrivate() {
65  delete session;
66  session = 0L;
67  }
68 
69  bool lastInitTLS;
70  KSSLCertificate::KSSLValidation m_cert_vfy_res;
71  TQString proxyPeer;
72 
73 #ifdef KSSL_HAVE_SSL
74  SSL *m_ssl;
75  SSL_CTX *m_ctx;
76  SSL_METHOD *m_meth;
77 #endif
78  KSSLSession *session;
79  KOSSL *kossl;
80 };
81 
82 
83 KSSL::KSSL(bool init) {
84  d = new KSSLPrivate;
85  m_bInit = false;
86  m_bAutoReconfig = true;
87  m_cfg = new KSSLSettings();
88 #ifdef KSSL_HAVE_SSL
89  d->m_ssl = 0L;
90 #endif
91 
92  if (init)
93  initialize();
94 }
95 
96 
97 KSSL::~KSSL() {
98  close();
99  delete m_cfg;
100  delete d;
101 }
102 
103 
104 int KSSL::seedWithEGD() {
105 int rc = 0;
106 #ifdef KSSL_HAVE_SSL
107  if (m_cfg->useEGD() && !m_cfg->getEGDPath().isEmpty()) {
108  rc = d->kossl->RAND_egd(m_cfg->getEGDPath().latin1());
109  if (rc < 0)
110  kdDebug(7029) << "KSSL: Error seeding PRNG with the EGD." << endl;
111  else kdDebug(7029) << "KSSL: PRNG was seeded with " << rc
112  << " bytes from the EGD." << endl;
113  } else if (m_cfg->useEFile() && !m_cfg->getEGDPath().isEmpty()) {
114  rc = d->kossl->RAND_load_file(m_cfg->getEGDPath().latin1(), -1);
115  if (rc < 0)
116  kdDebug(7029) << "KSSL: Error seeding PRNG with the entropy file." << endl;
117  else kdDebug(7029) << "KSSL: PRNG was seeded with " << rc
118  << " bytes from the entropy file." << endl;
119  }
120 #endif
121 return rc;
122 }
123 
124 
125 bool KSSL::TLSInit() {
126 #ifdef KSSL_HAVE_SSL
127 // kdDebug(7029) << "KSSL TLS initialize" << endl;
128  if (m_bInit)
129  return false;
130 
131  if (m_bAutoReconfig)
132  m_cfg->load();
133 
134  if (!m_cfg->tlsv1())
135  return false;
136 
137  seedWithEGD();
138  d->m_meth = d->kossl->TLSv1_client_method();
139  d->lastInitTLS = true;
140 
141  m_pi.reset();
142 
143  d->m_ctx = d->kossl->SSL_CTX_new(d->m_meth);
144  if (d->m_ctx == 0L) {
145  return false;
146  }
147 
148  // set cipher list
149  TQString clist = m_cfg->getCipherList();
150  //kdDebug(7029) << "Cipher list: " << clist << endl;
151  if (!clist.isEmpty())
152  d->kossl->SSL_CTX_set_cipher_list(d->m_ctx, const_cast<char *>(clist.ascii()));
153 
154  m_bInit = true;
155 return true;
156 #else
157 return false;
158 #endif
159 }
160 
161 
162 bool KSSL::initialize() {
163 #ifdef KSSL_HAVE_SSL
164  kdDebug(7029) << "KSSL initialize" << endl;
165  if (m_bInit)
166  return false;
167 
168  if (m_bAutoReconfig)
169  m_cfg->load();
170 
171  seedWithEGD();
172  // FIXME: we should be able to force SSL off entirely.
173  d->lastInitTLS = false;
174 
175  m_pi.reset();
176 
177  if (!m_cfg->tlsv1() && !m_cfg->sslv3() && m_cfg->sslv2())
178  d->m_meth = d->kossl->SSLv2_client_method();
179  else if (m_cfg->tlsv1() && !m_cfg->sslv3() && !m_cfg->sslv2())
180  d->m_meth = d->kossl->TLSv1_client_method();
181  else if (!m_cfg->tlsv1() && m_cfg->sslv3() && !m_cfg->sslv2())
182  d->m_meth = d->kossl->SSLv3_client_method();
183  else d->m_meth = d->kossl->SSLv23_client_method();
184 
185 /*
186 if (m_cfg->sslv2() && m_cfg->sslv3()) kdDebug(7029) << "Double method" << endl;
187 else if (m_cfg->sslv2()) kdDebug(7029) << "SSL2 method" << endl;
188 else if (m_cfg->sslv3()) kdDebug(7029) << "SSL3 method" << endl;
189 */
190 
191  d->m_ctx = d->kossl->SSL_CTX_new(d->m_meth);
192  if (d->m_ctx == 0L) {
193  return false;
194  }
195 
196  // set cipher list
197  TQString clist = m_cfg->getCipherList();
198  kdDebug(7029) << "Cipher list: " << clist << endl;
199  if (!clist.isEmpty())
200  d->kossl->SSL_CTX_set_cipher_list(d->m_ctx, const_cast<char *>(clist.ascii()));
201 
202  m_bInit = true;
203 return true;
204 #else
205 return false;
206 #endif
207 }
208 
209 
210 bool KSSL::setSession(const KSSLSession *session) {
211 #ifdef KSSL_HAVE_SSL
212  if (!session) {
213  delete d->session;
214  d->session = 0L;
215  return true;
216  }
217 
218  // Obtain a reference by incrementing the reference count. Yuck.
219  static_cast<SSL_SESSION*>(session->_session)->references++;
220 
221  d->session = new KSSLSession;
222  d->session->_session = session->_session;
223 
224  return true;
225 #else
226  return false;
227 #endif
228 }
229 
230 
231 void KSSL::close() {
232 #ifdef KSSL_HAVE_SSL
233 //kdDebug(7029) << "KSSL close" << endl;
234  if (!m_bInit)
235  return;
236 
237  delete d->session;
238  d->session = 0L;
239 
240  if (d->m_ssl) {
241  d->kossl->SSL_shutdown(d->m_ssl);
242  d->kossl->SSL_free(d->m_ssl);
243  d->m_ssl = 0L;
244  }
245 
246  d->kossl->SSL_CTX_free(d->m_ctx);
247  if (m_cfg->useEFile() && !m_cfg->getEGDPath().isEmpty()) {
248  d->kossl->RAND_write_file(m_cfg->getEGDPath().latin1());
249  }
250 
251  m_bInit = false;
252 #endif
253 }
254 
255 
256 bool KSSL::reInitialize() {
257  close();
258 return initialize();
259 }
260 
261 // get the callback file - it's hidden away in here
262 //#include "ksslcallback.c"
263 
264 
265 bool KSSL::setVerificationLogic() {
266 #if 0
267 #ifdef KSSL_HAVE_SSL
268  // SSL_set_verify_result(d->m_ssl, X509_V_OK);
269  // SSL_CTX_set_verify(d->m_ctx, SSL_VERIFY_PEER, X509Callback);
270 #endif
271 #endif
272 return true;
273 }
274 
275 
276 int KSSL::accept(int sock) {
277 #ifdef KSSL_HAVE_SSL
278 // kdDebug(7029) << "KSSL accept" << endl;
279 int rc;
280  if (!m_bInit)
281  return -1;
282  d->m_ssl = d->kossl->SSL_new(d->m_ctx);
283  if (!d->m_ssl)
284  return -1;
285 
286  if (d->session) {
287  if (static_cast<SSL_SESSION*>(d->session->_session)->sess_cert == 0)
288  {
289  kdDebug(7029) << "Can't reuse session, no certificate." << endl;
290  delete d->session;
291  d->session = 0;
292  } else if (1 == d->kossl->SSL_set_session(d->m_ssl,
293  static_cast<SSL_SESSION*>(d->session->_session))) {
294  kdDebug(7029) << "Session ID is being reused." << endl;
295  } else {
296  kdDebug(7029) << "Error attempting to reuse session." << endl;
297  delete d->session;
298  d->session = 0;
299  }
300  }
301 
302 /*
303  if (!setVerificationLogic()) {
304  d->kossl->SSL_shutdown(d->m_ssl);
305  d->kossl->SSL_free(d->m_ssl);
306  d->m_ssl = 0;
307  return -1;
308  }
309 */
310 
311  int off = SSL_OP_ALL;
312  if (!d->lastInitTLS && !m_cfg->tlsv1())
313  off |= SSL_OP_NO_TLSv1;
314  if (!m_cfg->sslv3())
315  off |= SSL_OP_NO_SSLv3;
316  if (!m_cfg->sslv2())
317  off |= SSL_OP_NO_SSLv2;
318 
319  d->kossl->SSL_set_options(d->m_ssl, off);
320 
321  rc = d->kossl->SSL_set_fd(d->m_ssl, sock);
322  if (rc == 0) {
323  d->kossl->SSL_shutdown(d->m_ssl);
324  d->kossl->SSL_free(d->m_ssl);
325  d->m_ssl = 0;
326  return rc;
327  }
328 
329  rc = d->kossl->SSL_accept(d->m_ssl);
330  if (rc == 1) {
331  setConnectionInfo();
332  setPeerInfo();
333  kdDebug(7029) << "KSSL connected OK" << endl;
334  } else {
335  kdDebug(7029) << "KSSL accept failed - rc = " << rc << endl;
336  kdDebug(7029) << " ERROR = "
337  << d->kossl->SSL_get_error(d->m_ssl, rc) << endl;
338  d->kossl->SSL_shutdown(d->m_ssl);
339  d->kossl->SSL_free(d->m_ssl);
340  d->m_ssl = 0;
341  return -1;
342  }
343 
344  if (!d->kossl->SSL_session_reused(d->m_ssl)) {
345  if (d->session) {
346  kdDebug(7029) << "Session reuse failed. New session used instead." << endl;
347  delete d->session;
348  d->session = 0L;
349  }
350  }
351 
352  if (!d->session) {
353  SSL_SESSION *sess = d->kossl->SSL_get1_session(d->m_ssl);
354  if (sess) {
355  d->session = new KSSLSession;
356  d->session->_session = sess;
357  }
358  }
359 
360 return rc;
361 #else
362 return -1;
363 #endif
364 }
365 
366 
367 int KSSL::connect(int sock) {
368 #ifdef KSSL_HAVE_SSL
369 // kdDebug(7029) << "KSSL connect" << endl;
370 int rc;
371  if (!m_bInit)
372  return -1;
373  d->m_ssl = d->kossl->SSL_new(d->m_ctx);
374  if (!d->m_ssl)
375  return -1;
376 
377  if (d->session) {
378  if (static_cast<SSL_SESSION*>(d->session->_session)->sess_cert == 0)
379  {
380  kdDebug(7029) << "Can't reuse session, no certificate." << endl;
381  delete d->session;
382  d->session = 0;
383  } else if (1 == d->kossl->SSL_set_session(d->m_ssl,
384  static_cast<SSL_SESSION*>(d->session->_session))) {
385  kdDebug(7029) << "Session ID is being reused." << endl;
386  } else {
387  kdDebug(7029) << "Error attempting to reuse session." << endl;
388  delete d->session;
389  d->session = 0;
390  }
391  }
392 
393 /*
394  if (!setVerificationLogic()) {
395  d->kossl->SSL_shutdown(d->m_ssl);
396  d->kossl->SSL_free(d->m_ssl);
397  d->m_ssl = 0;
398  return -1;
399  }
400 */
401 
402  int off = SSL_OP_ALL;
403  if (!d->lastInitTLS && !m_cfg->tlsv1())
404  off |= SSL_OP_NO_TLSv1;
405  if (!m_cfg->sslv3())
406  off |= SSL_OP_NO_SSLv3;
407  if (!m_cfg->sslv2())
408  off |= SSL_OP_NO_SSLv2;
409 
410  d->kossl->SSL_set_options(d->m_ssl, off);
411 
412  rc = d->kossl->SSL_set_fd(d->m_ssl, sock);
413  if (rc == 0) {
414  d->kossl->SSL_shutdown(d->m_ssl);
415  d->kossl->SSL_free(d->m_ssl);
416  d->m_ssl = 0;
417  return rc;
418  }
419 
420 connect_again:
421  rc = d->kossl->SSL_connect(d->m_ssl);
422  if (rc == 1) {
423  setConnectionInfo();
424  setPeerInfo();
425  kdDebug(7029) << "KSSL connected OK" << endl;
426  } else {
427  int err = d->kossl->SSL_get_error(d->m_ssl, rc);
428  if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) {
429  // nonblocking - but we block anyways in connect() :)
430  goto connect_again;
431  } else {
432  kdDebug(7029) << "KSSL connect failed - rc = "
433  << rc << endl;
434  kdDebug(7029) << " ERROR = "
435  << err << endl;
436  d->kossl->ERR_print_errors_fp(stderr);
437  d->kossl->SSL_shutdown(d->m_ssl);
438  d->kossl->SSL_free(d->m_ssl);
439  d->m_ssl = 0;
440  return -1;
441  }
442  }
443 
444  if (!d->kossl->SSL_session_reused(d->m_ssl)) {
445  if (d->session) {
446  kdDebug(7029) << "Session reuse failed. New session used instead." << endl;
447  delete d->session;
448  d->session = 0L;
449  }
450  }
451 
452  if (!d->session) {
453  SSL_SESSION *sess = d->kossl->SSL_get1_session(d->m_ssl);
454  if (sess) {
455  d->session = new KSSLSession;
456  d->session->_session = sess;
457  }
458  }
459 
460 return rc;
461 #else
462 return -1;
463 #endif
464 }
465 
466 
467 int KSSL::pending() {
468 #ifdef KSSL_HAVE_SSL
469  if (!m_bInit)
470  return -1;
471 return d->kossl->SSL_pending(d->m_ssl);
472 #else
473 return -1;
474 #endif
475 }
476 
477 
478 int KSSL::peek(void *buf, int len) {
479 #ifdef KSSL_HAVE_SSL
480  if (!m_bInit)
481  return -1;
482  // FIXME: enhance to work the way read() does below, handling errors
483 return d->kossl->SSL_peek(d->m_ssl, buf, len);
484 #else
485 return -1;
486 #endif
487 }
488 
489 
490 int KSSL::read(void *buf, int len) {
491 #ifdef KSSL_HAVE_SSL
492  int rc = 0;
493  int maxIters = 10;
494 
495  if (!m_bInit)
496  return -1;
497 
498 read_again:
499  rc = d->kossl->SSL_read(d->m_ssl, (char *)buf, len);
500  if (rc <= 0) {
501  int err = d->kossl->SSL_get_error(d->m_ssl, rc);
502 
503  if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) {
504  kdDebug(7029) << "SSL read() returning 0: " << err << endl;
505  if (maxIters-- > 0) {
506  ::usleep(20000); // 20ms sleep
507  goto read_again;
508  }
509  return 0;
510  }
511 
512  kdDebug(7029) << "SSL READ ERROR: " << err << endl;
513  if (err != SSL_ERROR_NONE &&
514  err != SSL_ERROR_ZERO_RETURN && err != SSL_ERROR_SYSCALL) {
515  rc = -1; // OpenSSL returns 0 on error too
516  d->kossl->ERR_print_errors_fp(stderr);
517  }
518 
519 // else if (err == SSL_ERROR_ZERO_RETURN)
520 // rc = 0;
521  }
522 return rc;
523 #else
524 return -1;
525 #endif
526 }
527 
528 
529 int KSSL::write(const void *buf, int len) {
530 #ifdef KSSL_HAVE_SSL
531  if (!m_bInit)
532  return -1;
533 
534 write_again:
535  int rc = d->kossl->SSL_write(d->m_ssl, (const char *)buf, len);
536  if (rc <= 0) { // OpenSSL returns 0 on error too
537  int err = d->kossl->SSL_get_error(d->m_ssl, rc);
538 
539  if (err == SSL_ERROR_WANT_WRITE) {
540  ::usleep(20000); // 20ms sleep
541  goto write_again;
542  }
543 
544  kdDebug(7029) << "SSL WRITE ERROR: " << err << endl;
545  if (err != SSL_ERROR_NONE &&
546  err != SSL_ERROR_ZERO_RETURN && err != SSL_ERROR_SYSCALL)
547  rc = -1;
548  }
549 
550 return rc;
551 #else
552 return -1;
553 #endif
554 }
555 
556 
557 bool KSSL::reconfig() {
558  return reInitialize();
559 }
560 
561 
562 void KSSL::setAutoReconfig(bool ar) {
563  m_bAutoReconfig = ar;
564 }
565 
566 
567 bool KSSL::setSettings(KSSLSettings *settings) {
568  delete m_cfg;
569  m_cfg = settings;
570  return reconfig();
571 }
572 
573 
574 #ifdef KSSL_HAVE_SSL
575 bool KSSL::m_bSSLWorks = true;
576 #else
577 bool KSSL::m_bSSLWorks = false;
578 #endif
579 
580 bool KSSL::doesSSLWork() {
581  return m_bSSLWorks;
582 }
583 
584 
585 void KSSL::setConnectionInfo() {
586 #ifdef KSSL_HAVE_SSL
587 SSL_CIPHER *sc;
588 char buf[1024];
589 
590  buf[0] = 0; // for safety.
591  sc = d->kossl->SSL_get_current_cipher(d->m_ssl);
592  if (!sc) {
593  kdDebug(7029) << "KSSL get current cipher failed - we're probably gonna crash!" << endl;
594  return;
595  }
596 
597  // set the number of bits, bits used
598  m_ci.m_iCipherUsedBits = d->kossl->SSL_CIPHER_get_bits(sc, &(m_ci.m_iCipherBits));
599  // set the cipher version
600  m_ci.m_cipherVersion = d->kossl->SSL_CIPHER_get_version(sc);
601  // set the cipher name
602  m_ci.m_cipherName = d->kossl->SSL_CIPHER_get_name(sc);
603  // set the cipher description
604  m_ci.m_cipherDescription = d->kossl->SSL_CIPHER_description(sc, buf, 1023);
605 
606 #endif
607 }
608 
609 
610 void KSSL::setPeerInfo() {
611 #ifdef KSSL_HAVE_SSL
612  m_pi.setPeerHost(d->proxyPeer);
613  m_pi.m_cert.setCert(d->kossl->SSL_get_peer_certificate(d->m_ssl));
614  STACK_OF(X509) *xs = d->kossl->SSL_get_peer_cert_chain(d->m_ssl);
615  if (xs)
616  xs = sk_X509_dup(xs); // Leak?
617  m_pi.m_cert.setChain((void *)xs);
618 #endif
619 }
620 
621 
622 KSSLConnectionInfo& KSSL::connectionInfo() {
623  return m_ci;
624 }
625 
626 
627 // KDE 4: Make it const TQString &
628 void KSSL::setPeerHost(TQString realHost) {
629  d->proxyPeer = realHost;
630 }
631 
632 // deprecated
633 void KSSL::setProxyUse(bool, TQString, int, TQString) {
634 }
635 
636 
637 KSSLPeerInfo& KSSL::peerInfo() {
638  return m_pi;
639 }
640 
641 
642 bool KSSL::setClientCertificate(KSSLPKCS12 *pkcs) {
643 #ifdef KSSL_HAVE_SSL
644  if (!pkcs || !pkcs->getCertificate())
645  return false;
646 
647 int rc;
648 X509 *x = pkcs->getCertificate()->getCert();
649 EVP_PKEY *k = pkcs->getPrivateKey();
650 
651  if (!x || !k) return false;
652 
653  if (!pkcs->getCertificate()->x509V3Extensions().certTypeSSLClient())
654  return false;
655 
656  rc = d->kossl->SSL_CTX_use_certificate(d->m_ctx, x);
657  if (rc <= 0) {
658  kdDebug(7029) << "KSSL - SSL_CTX_use_certificate failed. rc = " << rc << endl;
659  return false;
660  }
661 
662  rc = d->kossl->SSL_CTX_use_PrivateKey(d->m_ctx, k);
663  if (rc <= 0) {
664  kdDebug(7029) << "KSSL - SSL_CTX_use_PrivateKey failed. rc = " << rc << endl;
665  return false;
666  }
667 
668  return true;
669 #else
670  return false;
671 #endif
672 }
673 
674 #undef sk_dup
675 
676 const KSSLSession* KSSL::session() const {
677  return d->session;
678 }
679 
680 bool KSSL::reusingSession() const {
681 #ifdef KSSL_HAVE_SSL
682  return (d->m_ssl && d->kossl->SSL_session_reused(d->m_ssl));
683 #else
684  return false;
685 #endif
686 }
687 
688 
KSSL::reconfig
bool reconfig()
Trigger a reread of KSSL configuration and reInitialize() KSSL.
Definition: kssl.cc:557
KSSL::seedWithEGD
int seedWithEGD()
This will reseed the pseudo-random number generator with the EGD (entropy gathering daemon) if the EG...
Definition: kssl.cc:104
KSSL::session
const KSSLSession * session() const
Obtain a pointer to the session information.
Definition: kssl.cc:676
KSSL::initialize
bool initialize()
Initialize OpenSSL.
Definition: kssl.cc:162
KSSL::read
int read(void *buf, int len)
Read data from the remote host via SSL.
Definition: kssl.cc:490
KSSLCertificate::x509V3Extensions
KSSLX509V3 & x509V3Extensions()
Access the X.509v3 parameters.
Definition: ksslcertificate.cc:1087
KSSL::TLSInit
bool TLSInit()
This is used for applicationss which do STARTTLS or something similar.
Definition: kssl.cc:125
KSSL::KSSL
KSSL(bool init=true)
Construct a KSSL object.
Definition: kssl.cc:83
KSSL::~KSSL
~KSSL()
Destroy this KSSL object.
Definition: kssl.cc:97
KSSLPKCS12
KDE PKCS#12 Certificate.
Definition: ksslpkcs12.h:61
KSSL::setProxyUse
void setProxyUse(bool active, TQString realIP=TQString::null, int realPort=0, TQString proxy=TQString::null) KDE_DEPRECATED
Set the status of the connection with respect to proxies.
Definition: kssl.cc:633
KSSL::write
int write(const void *buf, int len)
Write data to the remote host via SSL.
Definition: kssl.cc:529
KSSLCertificate::KSSLValidation
KSSLValidation
A CA certificate can be validated as Irrelevant when it was not used to sign any other relevant certi...
Definition: ksslcertificate.h:113
KSSL::setClientCertificate
bool setClientCertificate(KSSLPKCS12 *pkcs)
Use this to set the certificate to send to the server.
Definition: kssl.cc:642
KSSL::peek
int peek(void *buf, int len)
Peek at available data from the remote host via SSL.
Definition: kssl.cc:478
KSSLX509V3::certTypeSSLClient
bool certTypeSSLClient()
Determine if this certificate can be used by an SSL client.
Definition: ksslx509v3.cc:85
KSSLPeerInfo
KDE SSL Peer Data.
Definition: ksslpeerinfo.h:42
KSSL::setPeerHost
void setPeerHost(TQString realHost=TQString::null)
Set the peer hostname to be used for certificate verification.
Definition: kssl.cc:628
KSSL::pending
int pending()
Determine if data is waiting to be read.
Definition: kssl.cc:467
KSSLSettings
KDE SSL Settings.
Definition: ksslsettings.h:39
KSSL::accept
int accept(int sock)
Connect the SSL session to the remote host using the provided socket descriptor.
Definition: kssl.cc:276
KSSLPKCS12::getPrivateKey
EVP_PKEY * getPrivateKey()
Get the private key.
Definition: ksslpkcs12.cc:186
KSSL::connect
int connect(int sock)
Connect the SSL session to the remote host using the provided socket descriptor.
Definition: kssl.cc:367
KSSL::peerInfo
KSSLPeerInfo & peerInfo()
Obtain a reference to the information about the peer.
Definition: kssl.cc:637
KSSLSession
KDE SSL Session Information.
Definition: ksslsession.h:42
KSSL::doesSSLWork
static bool doesSSLWork()
Determine if SSL is available and works.
Definition: kssl.cc:580
KSSL::reusingSession
bool reusingSession() const
Determine if we are currently reusing an SSL session ID.
Definition: kssl.cc:680
KSSL::setAutoReconfig
void setAutoReconfig(bool ar)
Enable or disable automatic reconfiguration on initialize().
Definition: kssl.cc:562
KSSL::connectionInfo
KSSLConnectionInfo & connectionInfo()
Obtain a reference to the connection information.
Definition: kssl.cc:622
KSSL::setSettings
bool setSettings(KSSLSettings *settings)
Set a new KSSLSettings instance as the settings.
Definition: kssl.cc:567
KSSLPKCS12::getCertificate
KSSLCertificate * getCertificate()
Get the X.509 certificate.
Definition: ksslpkcs12.cc:191
KSSL::close
void close()
Close the SSL session.
Definition: kssl.cc:231
KSSL::setSession
bool setSession(const KSSLSession *session)
Set an SSL session to use.
Definition: kssl.cc:210
KOpenSSLProxy::self
static KOpenSSLProxy * self()
Return an instance of class KOpenSSLProxy * You cannot delete this object.
Definition: kopenssl.cc:670
KSSL::reInitialize
bool reInitialize()
Reinitialize OpenSSL.
Definition: kssl.cc:256
KSSLConnectionInfo
KDE SSL Connection Information.
Definition: ksslconnectioninfo.h:40

tdeio/kssl

Skip menu "tdeio/kssl"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeio/kssl

Skip menu "tdeio/kssl"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/kssl by doxygen 1.8.11
This website is maintained by Timothy Pearson.