spyhunter99 commented on a change in pull request #67:
URL: https://github.com/apache/maven-wagon/pull/67#discussion_r430018381
##########
File path:
wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/TckTest.java
##########
@@ -20,6 +20,7 @@
*/
import org.apache.maven.wagon.tck.http.GetWagonTests;
+import org.apache.maven.wagon.tck.http.HttpsClientCertGetWagonTests;
Review comment:
good catch, i think i had attempted to enable that test profile for the
lightweight provider, but considering your explanation of when it's used, it's
out of scope anyhow.
##########
File path:
wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/JSSEKeyManager.java
##########
@@ -0,0 +1,139 @@
+package org.apache.maven.wagon.shared.http;
+
+/*
+ * 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.
+ */
+
+import java.net.Socket;
+import java.security.Principal;
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.X509ExtendedKeyManager;
+import javax.net.ssl.X509KeyManager;
+
+/**
+ * This was borrowed from Apache Tomcat
Review comment:
Doesn't look like it. I'll see if I can whip one up. The purpose of the
class is to force a selection for a specific certificate. The default JRE
implementation will pick the key pair that matches the server's criteria as
part of the hand shake. If you have more than one that matches the criteria but
only a specific one will allow access, you're hosed.
##########
File path:
wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/JSSEKeyManager.java
##########
@@ -0,0 +1,139 @@
+package org.apache.maven.wagon.shared.http;
+
+/*
+ * 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.
+ */
+
+import java.net.Socket;
+import java.security.Principal;
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.X509ExtendedKeyManager;
+import javax.net.ssl.X509KeyManager;
+
+/**
+ * This was borrowed from Apache Tomcat
Review comment:
Doesn't look like it. I'll see if I can whip one up. The purpose of the
class is to force a selection for a specific certificate. The default JRE
implementation will pick the first key pair that matches the server's criteria
as part of the hand shake. If you have more than one that matches the criteria
but only a specific one will allow access, you're hosed.
##########
File path:
wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/JSSEKeyManager.java
##########
@@ -0,0 +1,139 @@
+package org.apache.maven.wagon.shared.http;
+
+/*
+ * 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.
+ */
+
+import java.net.Socket;
+import java.security.Principal;
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.X509ExtendedKeyManager;
+import javax.net.ssl.X509KeyManager;
+
+/**
+ * This was borrowed from Apache Tomcat
Review comment:
actually i'm glad you brought this up, definitely needs a test case. I
shouldn't have copied tomcat's code without reading the details. It's purpose
is to select the server certificate to for when a single tomcat server hosts
multiple domains all in the same key store. We actually need the opposite,
client certificate selection.
----------------------------------------------------------------
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:
[email protected]