1a438d7062c43e114d15168a69c2bf08710a6e6f
[appc.git] / appc-config / appc-flow-controller / provider / src / main / java / org / onap / appc / flow / controller / executorImpl / SecureRestClientTrustManager.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * =============================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
20  * ============LICENSE_END=========================================================
21  */
22 package org.onap.appc.flow.controller.executorImpl;
23
24 import java.security.cert.CertificateException;
25 import java.security.cert.X509Certificate;
26
27 import javax.net.ssl.X509TrustManager;
28
29
30 public class SecureRestClientTrustManager implements X509TrustManager {
31
32     @Override
33     public void checkClientTrusted(X509Certificate[] arg0, String arg1)
34             throws CertificateException {
35     }
36
37     @Override
38     public void checkServerTrusted(X509Certificate[] arg0, String arg1)
39             throws CertificateException {
40     }
41
42     @Override
43     public X509Certificate[] getAcceptedIssuers() {
44         return new X509Certificate[0];
45     }
46
47     public boolean isClientTrusted(X509Certificate[] arg0) {
48         return true;
49     }
50
51     public boolean isServerTrusted(X509Certificate[] arg0) {
52         return true;
53     }
54
55 }