Skip to content

Commit

Permalink
fix: OF-2689 - only send a startTLS element if the connection is not …
Browse files Browse the repository at this point in the history
…encrypted (ie not using DirectTLS)
  • Loading branch information
AlexGidman authored and guusdk committed Oct 13, 2023
1 parent 8286c19 commit 9da5342
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public static LocalClientSession createSession(String serverName, XmlPullParser
document.getRootElement().add(features);

try {
if (connection.getConfiguration().getTlsPolicy() != Connection.TLSPolicy.disabled && !connection.getConfiguration().getIdentityStore().getAllCertificates().isEmpty()) {
if (!connection.isEncrypted() && connection.getConfiguration().getTlsPolicy() != Connection.TLSPolicy.disabled && !connection.getConfiguration().getIdentityStore().getAllCertificates().isEmpty()) {
final Element starttls = DocumentHelper.createElement(QName.get("starttls", "urn:ietf:params:xml:ns:xmpp-tls"));
if (connection.getConfiguration().getTlsPolicy() == Connection.TLSPolicy.required) {
starttls.addElement("required");
Expand Down

0 comments on commit 9da5342

Please sign in to comment.