use of com.vmware.flowgate.verifycert.VRopsAuth in project flowgate by vmware.
the class ServerValidationService method validateVROServer.
public void validateVROServer(SDDCSoftwareConfig server) {
try {
VRopsAuth ss = createVRopsAuth(server);
ss.getClient().apiVersionsClient().getCurrentVersion();
} catch (AuthException authException) {
throw new WormholeRequestException(HttpStatus.BAD_REQUEST, "Invalid user name or password.", authException.getCause());
} catch (Exception exception) {
if (exception.getCause() instanceof ConnectException) {
throw new WormholeRequestException(HttpStatus.BAD_REQUEST, "Failed to connect to server: " + server.getServerURL(), exception.getCause());
} else if (exception.getCause() instanceof SSLException) {
throw new WormholeRequestException(HttpStatus.BAD_REQUEST, "Certificate verification error", exception.getCause());
}
throw new WormholeRequestException("Internal error", exception.getCause());
}
}
Aggregations