Browse Source

KSSL: Use TLS_client_method instead of TLSv1_client_method

This enables TLS protocols newer than v1.0
This resolves bug 2764

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 2 years ago
parent
commit
adb9d9d2b0
1 changed files with 9 additions and 7 deletions
  1. 9
    7
      tdeio/kssl/kssl.cc

+ 9
- 7
tdeio/kssl/kssl.cc View File

@@ -134,7 +134,7 @@ bool KSSL::TLSInit() {
134 134
 		return false;
135 135
 
136 136
 	seedWithEGD();
137
-	d->m_meth = d->kossl->TLSv1_client_method();
137
+	d->m_meth = d->kossl->TLS_client_method();
138 138
 	d->lastInitTLS = true;
139 139
 
140 140
 	m_pi.reset();
@@ -173,13 +173,15 @@ bool KSSL::initialize() {
173 173
 
174 174
 	m_pi.reset();
175 175
 
176
-	if (!m_cfg->tlsv1() && !m_cfg->sslv3() && m_cfg->sslv2())
177
-		d->m_meth = d->kossl->SSLv2_client_method();
178
-        else if (m_cfg->tlsv1() && !m_cfg->sslv3() && !m_cfg->sslv2())
179
-		d->m_meth = d->kossl->TLSv1_client_method();
180
-	else if (!m_cfg->tlsv1() && m_cfg->sslv3() && !m_cfg->sslv2())
176
+	if (m_cfg->tlsv1() || (m_cfg->sslv3() && m_cfg->sslv2())) {
177
+		d->m_meth = d->kossl->TLS_client_method();
178
+	}
179
+	else if (m_cfg->sslv3()) {
181 180
 		d->m_meth = d->kossl->SSLv3_client_method();
182
-	else d->m_meth = d->kossl->TLS_client_method();
181
+	}
182
+	else if (m_cfg->sslv2()) {
183
+		d->m_meth = d->kossl->SSLv2_client_method();
184
+	}
183 185
 
184 186
 /*
185 187
 if (m_cfg->sslv2() && m_cfg->sslv3()) kdDebug(7029) << "Double method" << endl;

Loading…
Cancel
Save