update
This commit is contained in:
parent
2992f4f408
commit
4f46de8d00
3330 changed files with 394553 additions and 76939 deletions
28
.config/Code/User/History/-2754a774/L64B.java
Normal file
28
.config/Code/User/History/-2754a774/L64B.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.security.cert.CertificateFactory;
|
||||
|
||||
|
||||
public class Main{
|
||||
public static void main(String[] args){
|
||||
|
||||
HttpClient client = HttpClient.newHttpClient();
|
||||
try{
|
||||
CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
||||
InputStream certInputStream = Main.class.getResourceAsStream("/mycertificate.crt");
|
||||
|
||||
|
||||
|
||||
HttpRequest request = HttpRequest.newBuilder().uri(new URI("https://localhost:8000/greet")).build();
|
||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
System.out.println(response.body());
|
||||
}
|
||||
catch(Exception e){}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue