2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.freeboxos.internal.api;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.io.net.http.TlsCertificateProvider;
19 import org.osgi.service.component.annotations.Component;
22 * Provides a CertificateManager for the Freebox SSL certificate
24 * @author Gaƫl L'hopital - Initial Contribution
28 public class FreeboxTlsCertificateProvider implements TlsCertificateProvider {
30 private static final String CERTIFICATE_NAME = "freeboxECCRootCA.crt";
32 public static final String DEFAULT_NAME = "mafreebox.freebox.fr";
35 public String getHostName() {
40 public URL getCertificate() {
41 URL resource = Thread.currentThread().getContextClassLoader().getResource(CERTIFICATE_NAME);
42 if (resource != null) {
45 throw new IllegalStateException("Certificate '%s' not found or not accessible".formatted(CERTIFICATE_NAME));