codestates / codestates/Memory-It

[Error Handling] Mixed Content

Open
#33 0 comments 0 reactions 1 assignee Claimed by @cjhmoves33 View on GitHub
client Error!
Dominant language
JavaScript
Stars
1
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### 어떤 에러인가요?
+ https에서 http로 요청을 보낼 시 발생하는 에러

### 에러 메시지
```
Mixed Content: The page at 'https://도메인.com' was loaded over HTTPS,
but requested an insecure script
'http://도메인.com'.
This request has been blocked; the content must be served over HTTPS.
```

### 에러 핸들링 방법
HTTPS 배포과정에서 클라이언트와 서버와의 통신이 지속적으로 안되서 다양한 방법을 시도하는 도중 클라이언트(https)에서 서버(http)로 mix content요청을 보내게 됐을 때 만났다.
postman에서는 https요청이 정상적으로 가는데 브라우저상에서는 https요청은 아예 서버로 도착하지 못하고 http요청은 도착하는 상황이다.
그래서 클라이언트에서 요청을 http로 보내기를 시도했지만 클라이언트는 이미 https를 사용하고 있기 때문에 충돌이 발생한것이다.
여기서 뭔가 이상하다는 생각이 들었는데, 나는 분명 요청을 ELB를 통해 서버에 보내게 해놓았다. 그렇다면 클라이언트가 요청을 https로 보내야만 하는데 왜 https요청이 애초에 안보내지는가 이다.
일단 mixed content가 무엇인지 알았고 지금 일어나고 있는 문제는 근본적으로 다른 문제임을 알았다.

### 에러 핸들링을 위해 참고한 레퍼런스 링크

[레퍼런스 MDN](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content/How_to_fix_website_with_mixed_content)
[레퍼런스 Blog 1](https://okky.kr/article/697852)
[레퍼런스 Blog 2](https://sbiografia.tistory.com/19)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.