}
private void configureHttpClient(final DefaultHttpClient httpclient) throws GeneralSecurityException {
configureTrust(httpclient);
configureAuthentication(httpclient, BASIC, new BasicUserPrincipal(username));
if (enableKerberos) {
String spnServiceClass = kerberosUseHttpSpn ? "HTTP" : "WSMAN";
httpclient.getAuthSchemes().register(KERBEROS,
new WsmanKerberosSchemeFactory(!kerberosAddPortToSpn, spnServiceClass, unmappedAddress, unmappedPort));