nrg4878 commented on a change in pull request #1791:
URL: https://github.com/apache/hive/pull/1791#discussion_r552102961
##########
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 understand why this is done but feels odd that this throws a
SQLException. Can we throw something else here and then wrap it in a
SQLException in the calling method? Even a TTransportException would make sense
over SQLException (though it is not thrown from thrift).
----------------------------------------------------------------
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]