2014-07-23 2 views
1

Windows 8.1 응용 프로그램을 빌드하고 Windows.Web.HTTP.HTTPClient API를 사용하여 사용자 지정 SSO 로그인 서비스와 통신합니다. HTTPS에서 HTTP로 리디렉션합니다. 그것은 System.Net.HTTP와 잘 작동했다. 그러나 HTTPClient API는 Windows.Web.HTTP.HTTPClient API에서 예외를 제공합니다.Windows 8.1 Windows.Web.HTTP.HTTPClient - 안전하지 않은 보안 리디렉션 예외

URL - https://sso.rumba.int.pearsoncmg.com/sso/loginService?service=http://www.google.com?authservice=rumbasso&username=may23_rumba_edu1&password=pass&gateway=true

I 예외 얻고있다 -. "이 오류 코드와 연관된 텍스트를 찾을 수 없습니다 \ 연구 \ 없음 \ 연구 \ 비 보안 연결에 보안이 변경됩니다 요청을 리디렉션 nA의 \ 연구 \ n을 "

코드 조각

var baseFilter = new HttpBaseProtocolFilter(); 
baseFilter.AllowAutoRedirect = true; 
var httpClient = new HttpClient(baseFilter) 
serverURI = new Uri("https://sso.rumba.int.pearsoncmg.com/sso/loginService?service=http://www.google.com?authservice=rumbasso&username=may23_rumba_edu1&password=pass&gateway=true"); 
HttpResponseMessage response = await httpClient.GetAsync(serverURI); 

나는이 문제를 해결하기 위해 무엇을 할 수 있는지 알려주십시오.

답변

1

자동 해결을 사용하지 않도록 설정하고 수동으로 리디렉션을 수행 할 수 있습니다.

var filter = new HttpBaseProtocolFilter(); 
filter.AllowAutoRedirect = false; 
var client = new HttpClient(filter); 
var response = await client.GetAsync("the url"); 
var location = response.Headers["location"]; 
response = await client.GetAsync(new Uri(location)).AsTask(cancellationToken, progress); 
return await response.Content.ReadAsBufferAsync(); 

는 당신은 현명한 해결책을 발견하는 경우 알려 주시기 바랍니다, 그것은 도움이되기를 바랍니다.

알바로.

+0

감사합니다. Alvaro. 지금 당장은 서비스가 안전하도록 변경했습니다. 따라서 HTTPS에서 HTTPS 로의 리디렉션이 정상적으로 작동합니다. – user3867600

관련 문제