You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/03/07 22:32:36 UTC

[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #3380: Add SSL Certificate Validation to Traffic Router

rawlinp commented on a change in pull request #3380: Add SSL Certificate Validation to Traffic Router
URL: https://github.com/apache/trafficcontrol/pull/3380#discussion_r263597674
 
 

 ##########
 File path: traffic_router/connector/src/main/java/com/comcast/cdn/traffic_control/traffic_router/secure/CertificateDataConverter.java
 ##########
 @@ -17,30 +17,63 @@
 
 import com.comcast.cdn.traffic_control.traffic_router.shared.CertificateData;
 import org.apache.log4j.Logger;
+import org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPrivateCrtKey;
+import sun.security.rsa.RSAPrivateCrtKeyImpl;
+import sun.security.rsa.RSAPublicKeyImpl;
 
+import java.math.BigInteger;
 import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.security.cert.CertificateExpiredException;
+import java.security.cert.CertificateNotYetValidException;
 import java.security.cert.X509Certificate;
+import java.util.ArrayList;
 import java.util.List;
 
 Review comment:
   That's not how Java works. `List` is an interface of which you need a concrete implementation for, hence the `ArrayList`. Declaring it as an interface and assigning it a concrete implementation is generally best practice, as it allows you to swap in a different concrete implementation more easily without having to change every single place the `List` is used. For example, if we decided a `LinkedList` would work better for some reason, we'd only have to change it on this one line:
   ```
   final List<X509Certificate> x509Chain = new ArrayList<>();
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services