Skip to content

Commit cd0e178

Browse files
committed
Merge branch 'fix/tls-hostname-verification' of https://github.com/zerox80/android into fix/tls-hostname-verification
2 parents 17ba765 + 7fdcac7 commit cd0e178

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

opencloudApp/src/main/java/eu/opencloud/android/ui/dialog/SslUntrustedCertDialog.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
143143
Button ok = mView.findViewById(R.id.ok);
144144
ok.setOnClickListener(new OnCertificateTrusted());
145145

146+
Button cancel = mView.findViewById(R.id.btnCancel);
147+
cancel.setOnClickListener(new OnCertificateNotTrusted());
148+
146149
if (m509Certificate == null) {
147150
ok.setText(android.R.string.ok);
148151
mView.findViewById(R.id.question).setVisibility(View.GONE);
152+
cancel.setVisibility(View.GONE);
149153
}
150-
151-
Button cancel = mView.findViewById(R.id.btnCancel);
152-
cancel.setOnClickListener(new OnCertificateNotTrusted());
153-
154154
Button details = mView.findViewById(R.id.details_btn);
155155
details.setOnClickListener(new OnClickListener() {
156156

@@ -226,7 +226,7 @@ public void onClick(View v) {
226226
((OnSslUntrustedCertListener) activity).onFailedSavingCertificate();
227227
Timber.e(e, "Server certificate could not be saved in the known-servers trust store ");
228228
}
229-
} else {
229+
} else if (mHandler == null) {
230230
((OnSslUntrustedCertListener) getActivity()).onCancelCertificate();
231231
}
232232
}

0 commit comments

Comments
 (0)