Skip to content

Commit 82fd1c1

Browse files
authored
upgrade ftpserver to 1.1.2 (#235)
1 parent c78ce2b commit 82fd1c1

3 files changed

Lines changed: 73 additions & 2 deletions

File tree

commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/ftps/AbstractFtpsProviderTestCase.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.apache.ftpserver.ftplet.FtpException;
3434
import org.apache.ftpserver.ftplet.UserManager;
3535
import org.apache.ftpserver.listener.ListenerFactory;
36+
import org.apache.ftpserver.ssl.SslConfiguration;
3637
import org.apache.ftpserver.ssl.SslConfigurationFactory;
3738
import org.apache.ftpserver.usermanager.PropertiesUserManagerFactory;
3839
import org.apache.ftpserver.usermanager.impl.BaseUser;
@@ -137,7 +138,9 @@ static void setUpClass(final boolean implicit) throws FtpException, IOException
137138
ssl.setKeystorePassword("password");
138139

139140
// set the SSL configuration for the listener
140-
factory.setSslConfiguration(ssl.createSslConfiguration());
141+
SslConfiguration sslConfiguration = ssl.createSslConfiguration();
142+
NoProtocolSslConfigurationProxy noProtocolSslConfigurationProxy = new NoProtocolSslConfigurationProxy(sslConfiguration);
143+
factory.setSslConfiguration(noProtocolSslConfigurationProxy);
141144
factory.setImplicitSsl(implicit);
142145

143146
// replace the default listener
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.commons.vfs2.provider.ftps;
19+
20+
import java.security.GeneralSecurityException;
21+
import javax.net.ssl.SSLContext;
22+
import javax.net.ssl.SSLSocketFactory;
23+
24+
import org.apache.ftpserver.ssl.ClientAuth;
25+
import org.apache.ftpserver.ssl.SslConfiguration;
26+
27+
/**
28+
* see https://issues.apache.org/jira/browse/FTPSERVER-491
29+
*/
30+
public class NoProtocolSslConfigurationProxy implements SslConfiguration {
31+
32+
@Override
33+
public String getEnabledProtocol() {
34+
return null;
35+
}
36+
37+
private final SslConfiguration sslConfiguration;
38+
39+
public NoProtocolSslConfigurationProxy(SslConfiguration sslConfiguration) {
40+
this.sslConfiguration = sslConfiguration;
41+
}
42+
43+
@Override
44+
public SSLSocketFactory getSocketFactory() throws GeneralSecurityException {
45+
return this.sslConfiguration.getSocketFactory();
46+
}
47+
48+
@Override
49+
public SSLContext getSSLContext() throws GeneralSecurityException {
50+
return this.sslConfiguration.getSSLContext();
51+
}
52+
53+
@Override
54+
public SSLContext getSSLContext(String protocol) throws GeneralSecurityException {
55+
return this.sslConfiguration.getSSLContext(protocol);
56+
}
57+
58+
@Override
59+
public String[] getEnabledCipherSuites() {
60+
return this.sslConfiguration.getEnabledCipherSuites();
61+
}
62+
63+
@Override
64+
public ClientAuth getClientAuth() {
65+
return this.sslConfiguration.getClientAuth();
66+
}
67+
68+
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@
630630
<dependency>
631631
<groupId>org.apache.ftpserver</groupId>
632632
<artifactId>ftpserver-core</artifactId>
633-
<version>1.1.1</version>
633+
<version>1.1.2</version>
634634
</dependency>
635635
<dependency>
636636
<groupId>org.slf4j</groupId>

0 commit comments

Comments
 (0)