Search in sources :

Example 1 with StaticNewAdvancedCertificateVerifier

use of org.eclipse.californium.scandium.dtls.x509.StaticNewAdvancedCertificateVerifier in project thingsboard by thingsboard.

the class TbLwM2MDtlsBootstrapCertificateVerifier method init.

@SuppressWarnings("deprecation")
@PostConstruct
public void init() {
    try {
        /* by default trust all */
        if (config.getTrustSslCredentials() != null) {
            X509Certificate[] trustedCertificates = config.getTrustSslCredentials().getTrustedCertificates();
            staticCertificateVerifier = new StaticNewAdvancedCertificateVerifier(trustedCertificates, new RawPublicKeyIdentity[0], null);
        }
    } catch (Exception e) {
        log.warn("ailed to initialize the LwM2M certificate verifier", e);
    }
}
Also used : RawPublicKeyIdentity(org.eclipse.californium.elements.auth.RawPublicKeyIdentity) StaticNewAdvancedCertificateVerifier(org.eclipse.californium.scandium.dtls.x509.StaticNewAdvancedCertificateVerifier) X509Certificate(java.security.cert.X509Certificate) CertificateNotYetValidException(java.security.cert.CertificateNotYetValidException) CertificateExpiredException(java.security.cert.CertificateExpiredException) HandshakeException(org.eclipse.californium.scandium.dtls.HandshakeException) LwM2MAuthException(org.thingsboard.server.transport.lwm2m.server.client.LwM2MAuthException) CertificateEncodingException(java.security.cert.CertificateEncodingException) PostConstruct(javax.annotation.PostConstruct)

Example 2 with StaticNewAdvancedCertificateVerifier

use of org.eclipse.californium.scandium.dtls.x509.StaticNewAdvancedCertificateVerifier in project thingsboard by thingsboard.

the class TbLwM2MDtlsCertificateVerifier method init.

@PostConstruct
public void init() {
    try {
        /* by default trust all */
        if (config.getTrustSslCredentials() != null) {
            X509Certificate[] trustedCertificates = config.getTrustSslCredentials().getTrustedCertificates();
            staticCertificateVerifier = new StaticNewAdvancedCertificateVerifier(trustedCertificates, new RawPublicKeyIdentity[0], null);
        }
    } catch (Exception e) {
        log.warn("Failed to initialize the LwM2M certificate verifier", e);
    }
}
Also used : RawPublicKeyIdentity(org.eclipse.californium.elements.auth.RawPublicKeyIdentity) StaticNewAdvancedCertificateVerifier(org.eclipse.californium.scandium.dtls.x509.StaticNewAdvancedCertificateVerifier) X509Certificate(java.security.cert.X509Certificate) CertificateNotYetValidException(java.security.cert.CertificateNotYetValidException) CertificateExpiredException(java.security.cert.CertificateExpiredException) HandshakeException(org.eclipse.californium.scandium.dtls.HandshakeException) NonUniqueSecurityInfoException(org.eclipse.leshan.server.security.NonUniqueSecurityInfoException) LwM2MAuthException(org.thingsboard.server.transport.lwm2m.server.client.LwM2MAuthException) CertificateEncodingException(java.security.cert.CertificateEncodingException) PostConstruct(javax.annotation.PostConstruct)

Aggregations

CertificateEncodingException (java.security.cert.CertificateEncodingException)2 CertificateExpiredException (java.security.cert.CertificateExpiredException)2 CertificateNotYetValidException (java.security.cert.CertificateNotYetValidException)2 X509Certificate (java.security.cert.X509Certificate)2 PostConstruct (javax.annotation.PostConstruct)2 RawPublicKeyIdentity (org.eclipse.californium.elements.auth.RawPublicKeyIdentity)2 HandshakeException (org.eclipse.californium.scandium.dtls.HandshakeException)2 StaticNewAdvancedCertificateVerifier (org.eclipse.californium.scandium.dtls.x509.StaticNewAdvancedCertificateVerifier)2 LwM2MAuthException (org.thingsboard.server.transport.lwm2m.server.client.LwM2MAuthException)2 NonUniqueSecurityInfoException (org.eclipse.leshan.server.security.NonUniqueSecurityInfoException)1