File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
src/main/java/de/stklcode/jvault/connector Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 77* Support Vault transit API (#89 )
88* Support PEM certificate string from ` VAULT_CACERT ` environment variable (#93 )
99
10+ ### Improvements
11+ * Replace deprecated ` java.net.URL ` usage with ` java.net.URI ` (#94 )
12+
1013### Dependencies
1114* Updated Jackson to 2.18.3 (#90 )
1215
Original file line number Diff line number Diff line change 2222
2323import java .io .ByteArrayInputStream ;
2424import java .io .IOException ;
25- import java .net .MalformedURLException ;
2625import java .net .URI ;
2726import java .net .URISyntaxException ;
28- import java .net .URL ;
2927import java .nio .charset .StandardCharsets ;
3028import java .nio .file .Files ;
3129import java .nio .file .Path ;
@@ -305,11 +303,11 @@ public HTTPVaultConnectorBuilder fromEnv() throws VaultConnectorException {
305303 /* Parse URL from environment variable */
306304 if (System .getenv (ENV_VAULT_ADDR ) != null && !System .getenv (ENV_VAULT_ADDR ).isBlank ()) {
307305 try {
308- var url = new URL (System .getenv (ENV_VAULT_ADDR ));
309- this .host = url .getHost ();
310- this .port = url .getPort ();
311- this .tls = url . getProtocol ().equals ("https" );
312- } catch (MalformedURLException e ) {
306+ var uri = new URI (System .getenv (ENV_VAULT_ADDR ));
307+ this .host = uri .getHost ();
308+ this .port = uri .getPort ();
309+ this .tls = uri . getScheme ().equalsIgnoreCase ("https" );
310+ } catch (URISyntaxException e ) {
313311 throw new ConnectionException ("URL provided in environment variable malformed" , e );
314312 }
315313 }
You can’t perform that action at this time.
0 commit comments