Skip to content
This repository was archived by the owner on Jul 26, 2023. It is now read-only.

Commit 00b04f7

Browse files
Open jdk 11 (#30)
* BMP_2.1.36 * Update fluent d dependency * guice update * guice update * Update jdk * Update regarding jdk * one more update * jetty update
1 parent 8a3c252 commit 00b04f7

File tree

5 files changed

+89
-102
lines changed

5 files changed

+89
-102
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jdk:
66
# Not running tests against openjdk7, since the SunEC is not included in travis-ci's version of openjdk7.
77
# Not running tests against oraclejdk7, since travis-ci no longer provides it.
88
# - openjdk7
9-
- oraclejdk8
9+
- openjdk11
1010

1111
cache:
1212
directories:

browsermob-legacy/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<name>BrowserMob Proxy Legacy (Jetty) Module</name>
1515

1616
<properties>
17-
<unit-test-jetty.version>9.4.15.v20190215</unit-test-jetty.version>
17+
<unit-test-jetty.version>9.4.31.v20200723</unit-test-jetty.version>
1818
<use.littleproxy>true</use.littleproxy>
1919
</properties>
2020

browsermob-legacy/src/main/java/net/lightbody/bmp/proxy/jetty/http/SunJsseListener.java

Lines changed: 84 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515

1616
package net.lightbody.bmp.proxy.jetty.http;
1717

18-
import com.sun.net.ssl.*;
1918
import net.lightbody.bmp.proxy.jetty.log.LogFactory;
2019
import net.lightbody.bmp.proxy.jetty.util.InetAddrPort;
2120
import net.lightbody.bmp.proxy.jetty.util.Password;
2221
import org.apache.commons.logging.Log;
2322

24-
import javax.net.ssl.SSLServerSocketFactory;
23+
import javax.net.ssl.*;
2524
import java.io.File;
2625
import java.io.FileInputStream;
2726
import java.security.KeyStore;
@@ -30,175 +29,163 @@
3029

3130

3231
/* ------------------------------------------------------------ */
33-
/** SSL Socket Listener for Sun's JSSE.
34-
*
32+
33+
/**
34+
* SSL Socket Listener for Sun's JSSE.
35+
* <p>
3536
* This specialization of JsseListener is an specific listener
3637
* using the Sun reference implementation.
37-
*
38+
* <p>
3839
* This is heavily based on the work from Court Demas, which in
3940
* turn is based on the work from Forge Research.
4041
*
41-
* @version $Id: SunJsseListener.java,v 1.20 2005/08/13 00:01:24 gregwilkins Exp $
42-
* @deprecated Use org.mortbay.http.SslListener
4342
* @author Greg Wilkins (gregw@mortbay.com)
4443
* @author Court Demas (court@kiwiconsulting.com)
4544
* @author Forge Research Pty Ltd ACN 003 491 576
45+
* @version $Id: SunJsseListener.java,v 1.20 2005/08/13 00:01:24 gregwilkins Exp $
46+
* @deprecated Use org.mortbay.http.SslListener
4647
**/
47-
public class SunJsseListener extends JsseListener
48-
{
48+
public class SunJsseListener extends JsseListener {
4949
private static Log log = LogFactory.getLog(SunJsseListener.class);
5050

51-
private String _keystore=DEFAULT_KEYSTORE ;
51+
private String _keystore = DEFAULT_KEYSTORE;
5252
private transient Password _password;
5353
private transient Password _keypassword;
5454
private String _keystore_type = DEFAULT_KEYSTORE_TYPE;
5555
private String _keystore_provider_name = DEFAULT_KEYSTORE_PROVIDER_NAME;
5656
private String _keystore_provider_class = DEFAULT_KEYSTORE_PROVIDER_CLASS;
5757
private boolean _useDefaultTrustStore = false;
5858

59-
/* ------------------------------------------------------------ */
60-
static
61-
{
62-
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
63-
}
6459

6560
/* ------------------------------------------------------------ */
66-
public void setKeystore(String keystore)
67-
{
61+
public void setKeystore(String keystore) {
6862
_keystore = keystore;
6963
}
70-
64+
7165
/* ------------------------------------------------------------ */
72-
public String getKeystore()
73-
{
66+
public String getKeystore() {
7467
return _keystore;
7568
}
76-
69+
7770
/* ------------------------------------------------------------ */
78-
public void setPassword(String password)
79-
{
80-
_password = Password.getPassword(PASSWORD_PROPERTY,password,null);
71+
public void setPassword(String password) {
72+
_password = Password.getPassword(PASSWORD_PROPERTY, password, null);
8173
}
8274

8375
/* ------------------------------------------------------------ */
84-
public void setKeyPassword(String password)
85-
{
86-
_keypassword = Password.getPassword(KEYPASSWORD_PROPERTY,password,null);
76+
public void setKeyPassword(String password) {
77+
_keypassword = Password.getPassword(KEYPASSWORD_PROPERTY, password, null);
8778
}
88-
89-
79+
80+
9081
/* ------------------------------------------------------------ */
91-
public void setKeystoreType(String keystore_type)
92-
{
82+
public void setKeystoreType(String keystore_type) {
9383
_keystore_type = keystore_type;
9484
}
95-
85+
9686
/* ------------------------------------------------------------ */
97-
public String getKeystoreType()
98-
{
87+
public String getKeystoreType() {
9988
return _keystore_type;
10089
}
10190

10291
/* ------------------------------------------------------------ */
103-
public void setKeystoreProviderName(String name)
104-
{
92+
public void setKeystoreProviderName(String name) {
10593
_keystore_provider_name = name;
10694
}
10795

10896
/* ------------------------------------------------------------ */
109-
public String getKeystoreProviderName()
110-
{
97+
public String getKeystoreProviderName() {
11198
return _keystore_provider_name;
11299
}
113100

114101
/* ------------------------------------------------------------ */
115-
public String getKeystoreProviderClass()
116-
{
102+
public String getKeystoreProviderClass() {
117103
return _keystore_provider_class;
118104
}
119105

120106
/* ------------------------------------------------------------ */
121-
public void setKeystoreProviderClass(String classname)
122-
{
107+
public void setKeystoreProviderClass(String classname) {
123108
_keystore_provider_class = classname;
124109
}
125110

126111
/* ------------------------------------------------------------ */
112+
127113
/**
128114
* Gets the default trust store flag.
129115
*
130116
* @return true if the default truststore will be used to initialize the
131117
* TrustManager, false otherwise.
132118
*/
133-
public boolean getUseDefaultTrustStore()
134-
{
119+
public boolean getUseDefaultTrustStore() {
135120
return _useDefaultTrustStore;
136121
}
137122

138123
/* ------------------------------------------------------------ */
124+
139125
/**
140126
* Set a flag to determine if the default truststore should be used to
141127
* initialize the TrustManager. The default truststore will typically be
142128
* the ${JAVA_HOME}/jre/lib/security/cacerts.
143129
*
144130
* @param flag if true, the default truststore will be used. If false, the
145-
* configured keystore will be used as the truststore.
131+
* configured keystore will be used as the truststore.
146132
*/
147-
public void setUseDefaultTrustStore(boolean flag)
148-
{
133+
public void setUseDefaultTrustStore(boolean flag) {
149134
_useDefaultTrustStore = flag;
150135
}
151136

152137
/* ------------------------------------------------------------ */
153-
/** Constructor.
138+
139+
/**
140+
* Constructor.
154141
*/
155-
public SunJsseListener()
156-
{
142+
public SunJsseListener() {
157143
super();
158144
}
159145

160146
/* ------------------------------------------------------------ */
161-
/** Constructor.
162-
* @param p_address
147+
148+
/**
149+
* Constructor.
150+
*
151+
* @param p_address
163152
*/
164-
public SunJsseListener(InetAddrPort p_address)
165-
{
166-
super( p_address);
153+
public SunJsseListener(InetAddrPort p_address) {
154+
super(p_address);
167155
}
168-
156+
169157
/* ------------------------------------------------------------ */
170-
/*
171-
* @return
172-
* @exception Exception
158+
/*
159+
* @return
160+
* @exception Exception
173161
*/
174162
protected SSLServerSocketFactory createFactory()
175-
throws Exception
176-
{
177-
_keystore = System.getProperty( KEYSTORE_PROPERTY,_keystore);
178-
179-
log.info(KEYSTORE_PROPERTY+"="+_keystore);
180-
181-
if (_password==null)
182-
_password = Password.getPassword(PASSWORD_PROPERTY,null,null);
183-
log.info(PASSWORD_PROPERTY+"="+_password.toStarString());
184-
185-
if (_keypassword==null)
163+
throws Exception {
164+
_keystore = System.getProperty(KEYSTORE_PROPERTY, _keystore);
165+
166+
log.info(KEYSTORE_PROPERTY + "=" + _keystore);
167+
168+
if (_password == null)
169+
_password = Password.getPassword(PASSWORD_PROPERTY, null, null);
170+
log.info(PASSWORD_PROPERTY + "=" + _password.toStarString());
171+
172+
if (_keypassword == null)
186173
_keypassword = Password.getPassword(KEYPASSWORD_PROPERTY,
187-
null,
188-
_password.toString());
189-
log.info(KEYPASSWORD_PROPERTY+"="+_keypassword.toStarString());
174+
null,
175+
_password.toString());
176+
log.info(KEYPASSWORD_PROPERTY + "=" + _keypassword.toStarString());
190177

191178

192179
KeyStore ks = null;
193180

194-
log.info(KEYSTORE_TYPE_PROPERTY+"="+_keystore_type);
195-
181+
log.info(KEYSTORE_TYPE_PROPERTY + "=" + _keystore_type);
182+
196183
if (_keystore_provider_class != null) {
197184
// find provider.
198185
// avoid creating another instance if already installed in Security.
199186
java.security.Provider[] installed_providers = Security.getProviders();
200187
java.security.Provider myprovider = null;
201-
for (int i=0; i < installed_providers.length; i++) {
188+
for (int i = 0; i < installed_providers.length; i++) {
202189
if (installed_providers[i].getClass().getName().equals(_keystore_provider_class)) {
203190
myprovider = installed_providers[i];
204191
break;
@@ -209,37 +196,37 @@ protected SSLServerSocketFactory createFactory()
209196
myprovider = (java.security.Provider) Class.forName(_keystore_provider_class).newInstance();
210197
Security.addProvider(myprovider);
211198
}
212-
log.info(KEYSTORE_PROVIDER_CLASS_PROPERTY+"="+_keystore_provider_class);
213-
ks = KeyStore.getInstance(_keystore_type,myprovider.getName());
199+
log.info(KEYSTORE_PROVIDER_CLASS_PROPERTY + "=" + _keystore_provider_class);
200+
ks = KeyStore.getInstance(_keystore_type, myprovider.getName());
214201
} else if (_keystore_provider_name != null) {
215-
log.info(KEYSTORE_PROVIDER_NAME_PROPERTY+"="+_keystore_provider_name);
216-
ks = KeyStore.getInstance(_keystore_type,_keystore_provider_name);
202+
log.info(KEYSTORE_PROVIDER_NAME_PROPERTY + "=" + _keystore_provider_name);
203+
ks = KeyStore.getInstance(_keystore_type, _keystore_provider_name);
217204
} else {
218205
ks = KeyStore.getInstance(_keystore_type);
219-
log.info(KEYSTORE_PROVIDER_NAME_PROPERTY+"=[DEFAULT]");
206+
log.info(KEYSTORE_PROVIDER_NAME_PROPERTY + "=[DEFAULT]");
220207
}
221-
222-
ks.load( new FileInputStream( new File( _keystore ) ),
223-
_password.toString().toCharArray());
224-
225-
KeyManagerFactory km = KeyManagerFactory.getInstance( "SunX509","SunJSSE");
226-
km.init( ks, _keypassword.toString().toCharArray() );
227-
KeyManager[] kma = km.getKeyManagers();
228-
229-
TrustManagerFactory tm = TrustManagerFactory.getInstance("SunX509","SunJSSE");
208+
209+
ks.load(new FileInputStream(new File(_keystore)),
210+
_password.toString().toCharArray());
211+
212+
KeyManagerFactory km = KeyManagerFactory.getInstance("SunX509", "SunJSSE");
213+
km.init(ks, _keypassword.toString().toCharArray());
214+
KeyManager[] kma = km.getKeyManagers();
215+
216+
TrustManagerFactory tm = TrustManagerFactory.getInstance("SunX509", "SunJSSE");
230217
if (_useDefaultTrustStore) {
231-
tm.init( (KeyStore)null );
218+
tm.init((KeyStore) null);
232219
} else {
233-
tm.init( ks );
220+
tm.init(ks);
234221
}
235222

236223
TrustManager[] tma = tm.getTrustManagers();
237-
238-
SSLContext sslc = SSLContext.getInstance( "SSL" );
239-
sslc.init( kma, tma, SecureRandom.getInstance("SHA1PRNG"));
240-
224+
225+
SSLContext sslc = SSLContext.getInstance("SSL");
226+
sslc.init(kma, tma, SecureRandom.getInstance("SHA1PRNG"));
227+
241228
SSLServerSocketFactory ssfc = sslc.getServerSocketFactory();
242-
log.info("SSLServerSocketFactory="+ssfc);
229+
log.info("SSLServerSocketFactory=" + ssfc);
243230
return ssfc;
244231
}
245232
}

browsermob-rest/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@
6363
<dependency>
6464
<groupId>org.eclipse.jetty</groupId>
6565
<artifactId>jetty-server</artifactId>
66-
<version>9.4.21.v20190926</version>
66+
<version>9.4.31.v20200723</version>
6767
</dependency>
6868

6969
<dependency>
7070
<groupId>org.eclipse.jetty</groupId>
7171
<artifactId>jetty-servlet</artifactId>
72-
<version>9.4.21.v20190926</version>
72+
<version>9.4.31.v20200723</version>
7373
</dependency>
7474

7575
<dependency>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
<bouncycastle.version>1.66</bouncycastle.version>
8585
<java-statsd-client.version>3.0.1</java-statsd-client.version>
86-
<java.version>8</java.version>
86+
<java.version>11</java.version>
8787
<additionalJOption>-Xdoclint:none</additionalJOption>
8888
</properties>
8989

0 commit comments

Comments
 (0)