@Test public void getSecurityContext () throws Exception { String certFingerPrint = "CERTSHA256:F9:16:59:0B:93:72:66:A4:9A:DB:DF:2A:7F:8B:A3:CF:44:2B:A2:31:A8:1A:72:F5:7D:43:76:21:C6:2C:B3:81"; XMPPNotificationService service = new XMPPNotificationService(); assertEquals(SSLContext.getDefault(), service.getSecurityContext()); service.setServerCertFingerprint(certFingerPrint); assertNotEquals(SSLContext.getDefault(), service.getSecurityContext()); }
SSLContext getSecurityContext () throws NoSuchAlgorithmException, KeyManagementException { if (serverCertFingerprint != null && !serverCertFingerprint.isBlank()) { return JavaPinning.forPin(serverCertFingerprint); } return SSLContext.getDefault(); }
XMPPNotificationService { SSLContext getSecurityContext () throws NoSuchAlgorithmException, KeyManagementException { if (serverCertFingerprint != null && !serverCertFingerprint.isBlank()) { return JavaPinning.forPin(serverCertFingerprint); } return SSLContext.getDefault(); } }
XMPPNotificationService { SSLContext getSecurityContext () throws NoSuchAlgorithmException, KeyManagementException { if (serverCertFingerprint != null && !serverCertFingerprint.isBlank()) { return JavaPinning.forPin(serverCertFingerprint); } return SSLContext.getDefault(); }  }
XMPPNotificationService { SSLContext getSecurityContext () throws NoSuchAlgorithmException, KeyManagementException { if (serverCertFingerprint != null && !serverCertFingerprint.isBlank()) { return JavaPinning.forPin(serverCertFingerprint); } return SSLContext.getDefault(); }  void setUser(String user); void setPassword(String password); void setHostname(String hostname); void setServerCertFingerprint(String serverCertFingerprint); void setDomain(String domain); void setConferenceRooms(String conferenceRooms); void setRecipients(String recipients); }
XMPPNotificationService { SSLContext getSecurityContext () throws NoSuchAlgorithmException, KeyManagementException { if (serverCertFingerprint != null && !serverCertFingerprint.isBlank()) { return JavaPinning.forPin(serverCertFingerprint); } return SSLContext.getDefault(); }  void setUser(String user); void setPassword(String password); void setHostname(String hostname); void setServerCertFingerprint(String serverCertFingerprint); void setDomain(String domain); void setConferenceRooms(String conferenceRooms); void setRecipients(String recipients);  }