안녕하세요 <div>취미로 하는 독학 프로그래머입니다...</div> <div>Windows 10에서 Visual studio 2017 사용중이고, VB.Net 으로 프로그램을 하나 만들고 있습니다.</div> <div><br></div> <div>winhttp 를 이용해서 https 접속을 하려고 아래 코드를 사용하니</div> <div><hr></div> <div><div> Dim sQuery = "user=1111&password=1111"</div> <div> WinHTTP.Open("POST", "<a target="_blank" href="https://1.1.1.1/authorize">https://1.1.1.1/authorize</a>")</div> <div> WinHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")</div> <div> WinHTTP.SetRequestHeader("Referer", "<a target="_blank" href="https://1.1.1.1/login.html">https://1.1.1.1/login.html</a>")</div> <div> WinHTTP.Send(sQuery)</div> <div> WinHTTP.WaitForResponse()</div> <div> TextBox1.Text = WinHTTP.ResponseText</div></div> <div><hr><br></div> <div><br></div> <div>다음과 같은 예외 오류가 발생합니다</div> <div><hr></div> <div><font size="4" color="#c00000"><b style="background-color:#ffffff;">System.Runtime.InteropServices.COMException: '인증서 호스트 이름이 잘못되었거나 일치하지 않습니다.</b></font></div> <div><hr></div> <div>try~ 로 해보니 아예 결과가 안생겨서 <span style="font-size:9pt;">WinHTTP.ResponseText 가 없네요</span></div> <div><br></div> <div><br></div> <div>해당 페이지는 웹브라우저로 접속시에도 인증서 관련 문제로 접속이 바로 되지 않습니다.</div> <div>크롬에서는</div> <div><hr></div> <div><h1 style="color:#333333;font-size:1.6em;font-weight:normal;line-height:1.25em;margin-bottom:16px;font-family:'Segoe UI', Arial, 'Malgun Gothic', Gulim, sans-serif;background-color:#f7f7f7;">연결이 비공개로 설정되어 있지 않습니다.</h1> <p style="display:inline;color:#646464;font-family:'Segoe UI', Arial, 'Malgun Gothic', Gulim, sans-serif;font-size:15px;background-color:#f7f7f7;">공격자가 <strong>1.1.1.1 </strong>에서 사용자의 정보를 도용하려고 시도할 수 있습니다(예: 비밀번호, 메시지, 신용카드 정보).</p><span style="color:#646464;font-family:'Segoe UI', Arial, 'Malgun Gothic', Gulim, sans-serif;font-size:15px;background-color:#f7f7f7;"> </span> <div style="display:inline;overflow:auto;color:#646464;font-family:'Segoe UI', Arial, 'Malgun Gothic', Gulim, sans-serif;font-size:15px;background-color:#f7f7f7;"> <div class="error-code" style="display:inline;font-size:.86667em;margin-top:15px;text-transform:uppercase;">NET::ERR_CERT_COMMON_NAME_INVALID</div></div></div> <div><div style="display:inline;overflow:auto;color:#646464;font-family:'Segoe UI', Arial, 'Malgun Gothic', Gulim, sans-serif;font-size:15px;background-color:#f7f7f7;"> <div class="error-code" style="display:inline;font-size:.86667em;margin-top:15px;text-transform:uppercase;"> <hr></div></div></div> <div>라는 오류메세지가 뜨고, 링크를 수동으로 눌러야 접속이 가능합니다.</div> <div>인터넷익스플로러에서도 비슷한 오류가 뜨나, 인터넷 옵션 설정에서 관련 옵션을 끄니 경고없이 접속은 됩니다.</div> <div><br></div> <div><br></div> <div><br></div> <div>인증서가 잘못되어서 그런 것 같아 구글링 해 본 결과</div> <div><hr></div> <div><div>System.Net.ServicePointManager.ServerCertificateValidationCallback =</div> <div> Function(se As Object, <span style="font-size:9pt;">cert As System.Security.Cryptography.X509Certificates.X509Certificate, </span><span style="font-size:9pt;">chain As System.Security.Cryptography.X509Certificates.X509Chain, </span><span style="font-size:9pt;">sslerror As System.Net.Security.SslPolicyErrors) True</span></div></div> <div><hr></div> <div>라는 코드를 먼저 실행 하면 인증서 문제를 Bypass 할수있다 하여 시도 해 보았지만 해결되지 않았습니다.</div> <div><br></div> <div><br></div> <div>어떻게 해결할 수 있을까요</div> <div>도움 부탁 드립니다!</div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.