Skip to content

Commit

Permalink
https access added
Browse files Browse the repository at this point in the history
  • Loading branch information
Suleiman authored and Suleiman committed Sep 13, 2018
1 parent 49e67de commit 507ae1e
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/edu/iris/dmc/service/TrustAnyHostnameVerifier.java
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 src/main/java/edu/iris/dmc/service/TrustAnyTrustManager.java
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 src/test/java/edu/iris/dmc/service/StationServiceTest.java
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");
}
}

0 comments on commit 507ae1e

Please sign in to comment.