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

配置文件中,开启https选项开启,但实际上未开启 #340

Closed
winfredLIN opened this issue Dec 19, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working publish-pre1
Milestone

Comments

@winfredLIN
Copy link
Collaborator

winfredLIN commented Dec 19, 2024

配置文件中开启https
image
使用https schema访问sqle
image
使用http schema 访问sqle
image

实际上,在代码中,enable https这个字段并未被引用。相关实现未实现

如何测试

  1. 配置https,然后启动dms
  2. 打开sqle界面,使用http无法访问,使用https可以访问

启用HTTPS所需的SSL/TLS证书文件:

  1. cert.pem - 这是SSL证书文件,包含服务器的公钥和身份信息。它用于向客户端证明服务器的身份。

  2. key.pem - 这是私钥文件,配合证书使用,用于加密和解密HTTPS通信数据。

要生成这两个文件,你可以使用OpenSSL工具创建自签名证书。以下是简单的生成方法:

# 进入目标目录
cd /root/ee/dms/.vscode/

# 生成私钥和自签名证书(有效期365天)
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes

执行命令后,系统会提示你输入一些信息(国家、组织等),填写完成后就会在指定目录生成这两个文件。

注意:自签名证书会在浏览器中显示不安全警告。如果是生产环境,建议使用Let's Encrypt等服务获取受信任的免费证书。

@winfredLIN
Copy link
Collaborator Author

winfredLIN commented Mar 5, 2025

影响面分析

  1. SQLE和DMS存在互相调用的情况
  2. 存在外部程序调用DMS
    在上述情况中,如果DMS启动https,会不兼容http的请求,需要将http的请求同时变更,变为兼容http和https

目前,在sqle中,存在一些写死的http schema,包括:

  1. sqle向dms注册sqle
  2. sqle调用sqle时
    而sqle调用dms时都使用了可配置的dmsServerAddress
    注意:sqle中存在2处未考虑https的情况的代码,需要增加TODO 后续处理

在dms中,存在一个引用自身的写死的http schema,需要修改

Image

@winfredLIN
Copy link
Collaborator Author

实现

开启http后,sqle无法通过http协议访问
Image
可以根据https协议访问
Image
访问效果
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working publish-pre1
Projects
None yet
Development

No branches or pull requests

4 participants