Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compotible with 360 browser #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zzl360
Copy link

@zzl360 zzl360 commented Mar 4, 2022

360 browser sent two TLCP ciphersuites(0xe013 and 0xe053) in
tls clienthello's ciphersuites to indicate that it support TLCP
protocol

360 browser sent two TLCP ciphersuites(0xe013 and 0xe053) in
tls clienthello's ciphersuites to indicate that it support TLCP
protocol
@zzl360
Copy link
Author

zzl360 commented Mar 4, 2022

360浏览器连接网站时,先发送tls(clienthello里加0xe013和0xe053这俩国密套件声明自己支持国密协议)连服务器,如果服务器只支持国密(只配置了国密证书的情况),返回握手失败,360浏览器再发送国密协议尝试用国密连接。但如果服务器即配置了国密证书,又配置了rsa证书,在360浏览器第一次发送tls连接的时候,将返回tls协议,造成无法优先选用国密协议。
本patch兼容了这种场景,识别360浏览器是否支持国密,如果支持的话(配置了国密加密证书,以区分只配置签名证书用于RFC8998的情况),自动切换到国密协议进行连接。

@jntass
Copy link
Owner

jntass commented Mar 18, 2022

客户端使用标准的TLS client hello + TLCP cipher suites发起请求,服务端使用TLCP协议完成握手,有点类似于TLS的降级方式。但这种流程似乎不完全符合TLCP协议

@zzl360
Copy link
Author

zzl360 commented Mar 18, 2022

是的。这个根本原因还是协议version的问题。tls的0x0303和tlcp的0x0101从根本上无法兼容。只能做一些特殊处理了。在实际应用中,如果服务端配置了国密证书,那么其初衷应该也是希望默认能支持国密的客户端用国密协议来通信的,而tls是留给不支持国密协议的客户端的。这个patch在实际使用中还是有应用场景的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants