Created
January 14, 2021 08:49
-
-
Save yusuke/47ddf134057874332366247dedaa29ce to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import java.io.*; | |
import java.net.URL; | |
import java.net.URLConnection; | |
public class ClientCertificate { | |
public static void main(String[] args) throws IOException { | |
System.setProperty("javax.net.ssl.keyStore", "myClientCert.p12"); | |
System.setProperty("javax.net.ssl.keyStorePassword", "mypassword"); | |
final URLConnection urlConnection = new URL("https://bizstn.bk.mufg.jp/biz/yen/dfw/Login").openConnection(); | |
try (InputStream is = urlConnection.getInputStream()) { | |
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | |
int data; | |
while(-1 != (data = is.read())){ | |
byteArrayOutputStream.write(data); | |
} | |
System.out.println(byteArrayOutputStream.toString()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment