@Override public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { if (handshake == null) return null; return handshake.peerPrincipal(); }
@Override public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { Handshake handshake = handshake(); return handshake != null ? handshake.peerPrincipal() : null; }
/** * Returns a Map of flowfile attributes from the response http headers. Multivalue headers are naively converted to comma separated strings. */ private Map<String, String> convertAttributesFromHeaders(URL url, Response responseHttp){ // create a new hashmap to store the values from the connection Map<String, String> map = new HashMap<>(); responseHttp.headers().names().forEach( (key) -> { if (key == null) { return; } List<String> values = responseHttp.headers().values(key); // we ignore any headers with no actual values (rare) if (values == null || values.isEmpty()) { return; } // create a comma separated string from the values, this is stored in the map String value = csv(values); // put the csv into the map map.put(key, value); }); if (responseHttp.request().isHttps()) { Principal principal = responseHttp.handshake().peerPrincipal(); if (principal != null) { map.put(REMOTE_DN, principal.getName()); } } return map; }
@Override public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { if (handshake == null) return null; return handshake.peerPrincipal(); }
@Override public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { Handshake handshake = handshake(); return handshake != null ? handshake.peerPrincipal() : null; }
@Override public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { Handshake handshake = handshake(); return handshake != null ? handshake.peerPrincipal() : null; }
@Override public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { Handshake handshake = handshake(); return handshake != null ? handshake.peerPrincipal() : null; }
/** * Returns a Map of flowfile attributes from the response http headers. Multivalue headers are naively converted to comma separated strings. */ private Map<String, String> convertAttributesFromHeaders(URL url, Response responseHttp){ // create a new hashmap to store the values from the connection Map<String, String> map = new HashMap<>(); responseHttp.headers().names().forEach( (key) -> { if (key == null) { return; } List<String> values = responseHttp.headers().values(key); // we ignore any headers with no actual values (rare) if (values == null || values.isEmpty()) { return; } // create a comma separated string from the values, this is stored in the map String value = csv(values); // put the csv into the map map.put(key, value); }); if ("HTTPS".equals(url.getProtocol().toUpperCase())) { map.put(REMOTE_DN, responseHttp.handshake().peerPrincipal().getName()); } return map; }