안녕하세요 프로그램 개발중인 학생입니다.
Socket socket1 = new Socket(host1, port1);
OutputStream out1;
out1 = socket1.getOutputStream();
out1.write(("GET aaaa.php HTTP/1.1\r\nHost: xxx.xxx.xx.xxx:443/\r\nCookie: PHPSESSID="+ item.get(position).token + ";\r\n\r\n\r\n").getBytes());
라는 방식으로 호출을 하려고 하는데, 아무리 해봐도 되지를 않네요.
패킷을 까보니
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
Reason: You're speaking plain HTTP to an SSL-enabled server port.<br />
Instead use the HTTPS scheme to access this URL, please.<br />
<blockquote>Hint: <a href="https://127.0.0.1/"><b>https://127.0.0.1/</b></a></blockquote></p>
<hr>
<address>Apache Server at <a href="mailto:admin@localhost">127.0.0.1</a> Port 443</address>
</body></html>
라는 값이 들어있더라구요..
정확히 어느 부분에서 문제가 발생하여 접근이 안되는지 모르겠습니다.
aaaa.php는 정상작동함을 확인하였구요.
제 생각으로는 HTTP/1.1 부분 또는 Host부분에서 문제가 발생한 것 같은데 정확히 아시는분이
설명해주시면 감사하겠습니다 ㅠㅠ