use of password.pwm.http.client.PwmHttpClient in project pwm by pwm-project.
the class RestFormDataClient method getHttpClient.
private PwmHttpClient getHttpClient(final Configuration configuration) throws PwmUnrecoverableException {
final List<X509Certificate> certificates = remoteWebServiceConfiguration.getCertificates();
final PwmHttpClientConfiguration pwmHttpClientConfiguration = PwmHttpClientConfiguration.builder().certificates(certificates).build();
return new PwmHttpClient(pwmApplication, null, pwmHttpClientConfiguration);
}
use of password.pwm.http.client.PwmHttpClient in project pwm by pwm-project.
the class RemoteVerificationMethod method init.
@Override
public void init(final PwmApplication pwmApplication, final UserInfo userInfo, final SessionLabel sessionLabel, final Locale locale) throws PwmUnrecoverableException {
pwmHttpClient = new PwmHttpClient(pwmApplication, sessionLabel);
this.userInfo = userInfo;
this.sessionLabel = sessionLabel;
this.locale = locale;
this.pwmApplication = pwmApplication;
this.url = pwmApplication.getConfig().readSettingAsString(PwmSetting.EXTERNAL_MACROS_REMOTE_RESPONSES_URL);
if (url == null || url.isEmpty()) {
final String errorMsg = PwmSetting.EXTERNAL_MACROS_REMOTE_RESPONSES_URL.toMenuLocationDebug(null, PwmConstants.DEFAULT_LOCALE) + " must be configured for remote responses";
final ErrorInformation errorInformation = new ErrorInformation(PwmError.ERROR_INVALID_CONFIG, errorMsg);
LOGGER.error(sessionLabel, errorInformation);
throw new PwmUnrecoverableException(errorInformation);
}
sendRemoteRequest(null);
}
Aggregations