File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
src/main/java/com/rabbitmq/client/impl Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1818import com .fasterxml .jackson .databind .ObjectMapper ;
1919import com .rabbitmq .client .TrustEverythingTrustManager ;
2020
21+ import java .net .*;
2122import java .util .concurrent .atomic .AtomicReference ;
2223import java .util .function .Function ;
2324import javax .net .ssl .*;
2425import java .io .*;
25- import java .net .HttpURLConnection ;
26- import java .net .URL ;
27- import java .net .URLEncoder ;
2826import java .nio .charset .StandardCharsets ;
2927import java .security .KeyManagementException ;
3028import java .security .NoSuchAlgorithmException ;
@@ -230,7 +228,7 @@ protected Token retrieveToken() {
230228 }
231229 byte [] postData = urlParameters .toString ().getBytes (StandardCharsets .UTF_8 );
232230 int postDataLength = postData .length ;
233- URL url = new URL (tokenEndpointUri );
231+ URL url = new URI (tokenEndpointUri ). toURL ( );
234232
235233 HttpURLConnection conn = (HttpURLConnection ) url .openConnection ();
236234
@@ -256,7 +254,7 @@ protected Token retrieveToken() {
256254 checkContentType (conn .getHeaderField ("content-type" ));
257255
258256 return parseToken (extractResponseBody (conn .getInputStream ()));
259- } catch (IOException e ) {
257+ } catch (IOException | URISyntaxException e ) {
260258 throw new OAuthTokenManagementException ("Error while retrieving OAuth 2 token" , e );
261259 }
262260 }
You can’t perform that action at this time.
0 commit comments