Github user alopresto commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/695#discussion_r72740653
  
    --- Diff: 
nifi-toolkit/nifi-toolkit-tls/src/main/java/org/apache/nifi/toolkit/tls/service/TlsCertificateAuthorityClientSocketFactory.java
 ---
    @@ -0,0 +1,77 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.nifi.toolkit.tls.service;
    +
    +import org.apache.http.HttpHost;
    +import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
    +import org.apache.http.protocol.HttpContext;
    +import org.bouncycastle.asn1.x500.style.BCStyle;
    +import org.bouncycastle.asn1.x500.style.IETFUtils;
    +import org.bouncycastle.cert.jcajce.JcaX509CertificateHolder;
    +
    +import javax.net.ssl.SSLContext;
    +import javax.net.ssl.SSLSocket;
    +import java.io.IOException;
    +import java.net.InetSocketAddress;
    +import java.net.Socket;
    +import java.security.cert.X509Certificate;
    +import java.util.List;
    +
    +/**
    + * Socket Factory validates that it is talking to a RootCa claiming to 
have the given hostname.  It adds the certificate
    + * to a list for later validation against the payload's hmac
    + */
    +public class TlsCertificateAuthorityClientSocketFactory extends 
SSLConnectionSocketFactory {
    +    private final String caHostname;
    +    private final List<X509Certificate> certificates;
    +
    +    public TlsCertificateAuthorityClientSocketFactory(SSLContext 
sslContext, String caHostname, List<X509Certificate> certificates) {
    --- End diff --
    
    Because we are only using this for direct communication between NiFi nodes 
and NiFi CAs, we don't have to worry about legacy compatibility, so we can 
restrict the TLS protocol version to `TLSv1.2` to enforce a strong protocol 
with strong and fast cipher suites. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to