vihangk1 commented on a change in pull request #1791:
URL: https://github.com/apache/hive/pull/1791#discussion_r552246893



##########
File path: jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
##########
@@ -476,12 +511,18 @@ private String getServerHttpUrl(boolean useSsl) {
   private TTransport createHttpTransport() throws SQLException, 
TTransportException {
     CloseableHttpClient httpClient;
     boolean useSsl = isSslConnection();
-    // Create an http client from the configs
+    validateSslForBrowserMode();
     httpClient = getHttpClient(useSsl);
     transport = new THttpClient(getServerHttpUrl(useSsl), httpClient);
     return transport;
   }
 
+  protected void validateSslForBrowserMode() throws SQLException {
+    if (isBrowserAuthMode() && !isSslConnection()) {
+      throw new SQLException("Browser mode is only supported with SSL is 
enabled");

Review comment:
       I updated the code to throw a new SQLException(new 
IllegalArgumentException()) here. However, I don't see what is the real benefit 
of doing this way since the constructor of HiveConnection only allows for 
SQLException to be thrown.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to