-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Suleiman
authored and
Suleiman
committed
Sep 13, 2018
1 parent
49e67de
commit 507ae1e
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/main/java/edu/iris/dmc/service/TrustAnyHostnameVerifier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package edu.iris.dmc.service; | ||
|
||
import javax.net.ssl.HostnameVerifier; | ||
import javax.net.ssl.SSLSession; | ||
|
||
/** | ||
* Util4J | ||
* @author Util4J | ||
* | ||
*/ | ||
public class TrustAnyHostnameVerifier implements HostnameVerifier { | ||
|
||
public boolean verify(String hostname, SSLSession session) { | ||
return true; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/edu/iris/dmc/service/TrustAnyTrustManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package edu.iris.dmc.service; | ||
|
||
import java.security.cert.CertificateException; | ||
import java.security.cert.X509Certificate; | ||
|
||
import javax.net.ssl.X509TrustManager; | ||
|
||
/** | ||
* Util4J | ||
* @author Util4J | ||
* | ||
*/ | ||
public class TrustAnyTrustManager implements X509TrustManager { | ||
|
||
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { | ||
} | ||
|
||
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { | ||
} | ||
|
||
public X509Certificate[] getAcceptedIssuers() { | ||
return new X509Certificate[] {}; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/test/java/edu/iris/dmc/service/StationServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package edu.iris.dmc.service; | ||
|
||
import java.util.List; | ||
|
||
import org.junit.Test; | ||
|
||
import edu.iris.dmc.criteria.SacpzCriteria; | ||
import edu.iris.dmc.fdsn.station.model.Network; | ||
import edu.iris.dmc.sacpz.model.Sacpz; | ||
import edu.iris.dmc.ws.util.DateUtil; | ||
import edu.iris.dmc.ws.util.RespUtil; | ||
|
||
public class StationServiceTest { | ||
|
||
@Test | ||
public void fetch() throws Exception { | ||
|
||
StationService service = ServiceUtil.getInstance().getStationService(); | ||
List<Network> networks=service.fetch("https://fdsnws.raspberryshakedata.com/fdsnws/station/1/query?format=text&level=channel"); | ||
} | ||
} |