Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7BF28200BEA for ; Mon, 12 Dec 2016 14:29:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7AB16160B0D; Mon, 12 Dec 2016 13:29:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CC345160B22 for ; Mon, 12 Dec 2016 14:28:59 +0100 (CET) Received: (qmail 67335 invoked by uid 500); 12 Dec 2016 13:28:58 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 67313 invoked by uid 99); 12 Dec 2016 13:28:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2016 13:28:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 819102C03E1 for ; Mon, 12 Dec 2016 13:28:58 +0000 (UTC) Date: Mon, 12 Dec 2016 13:28:58 +0000 (UTC) From: "Adam Lynam (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (NET-605) FTPSClient forces IP in SubjectAlternativeNames field for server certificate validation instead of hostname MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 12 Dec 2016 13:29:00 -0000 [ https://issues.apache.org/jira/browse/NET-605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15741883#comment-15741883 ] Adam Lynam edited comment on NET-605 at 12/12/16 1:28 PM: ---------------------------------------------------------- The answer to this is probably setting the original hostname, instead of the IP (held in the host variable), when creating the SSLSocket inside FTPSClient on line 268: SSLSocket socket = (SSLSocket) ssf.createSocket(_socket_, host, port, false); I am not sure what other impact this might have though. was (Author: adam.lynam.dwp): The answer to this is probably setting the original hostname, instead of the IP (held in the host variable), when creating the SSLSocket: SSLSocket socket = (SSLSocket) ssf.createSocket(_socket_, host, port, false); I am not sure what other impact this might have though. > FTPSClient forces IP in SubjectAlternativeNames field for server certificate validation instead of hostname > ----------------------------------------------------------------------------------------------------------- > > Key: NET-605 > URL: https://issues.apache.org/jira/browse/NET-605 > Project: Commons Net > Issue Type: Bug > Components: FTP > Affects Versions: 3.5 > Reporter: Adam Lynam > > We have an FTP Server with a signed certificate, with both CN and SAN DNS entries set to the respective hostname of the machine. > When attempting to connect using FTPSClient, we get java.security.cert.CertificateException: No subject alternative names matching IP address x.x.x.x found. The FTPSClient appears to resolve the IP address and pass that through the SSLSocket where it eventually raises the exception. > While we initially encountered the error against our internal FTP server, we have confirmed the same issue against a public FTP server. ftps://demo:password@test.rebex.net. -- This message was sent by Atlassian JIRA (v6.3.4#6332)