AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题

问题[https](unix)

Martin Hope
user398389
Asked: 2020-03-04 07:09:53 +0800 CST

我想阻止对所有 http 的访问

  • 0

在 Linux 系统上,我需要阻止对除 Web 服务器 192.168.1.253 之外的所有 http 和 https 流量的出站访问。系统还应该阻止除 ssh 之外的所有传入流量。

我将如何配置它?

ssh https
  • 1 个回答
  • 629 Views
Martin Hope
Nani
Asked: 2019-02-28 08:54:33 +0800 CST

如何在同一域中为多个端口配置“https”?

  • 4

我有一个网站(apache web 服务器,ubuntu 14.04)设置http://example.com并配置了端口 1996 和 1980。

这些链接适用于http

http://example.com/myproject
http://example.com:1996/
http://example.com:1980/

然后我安装了 SSL 证书并将此服务器配置为使用https.

但是这些链接不起作用

https://example.com:1996 
https://example.com:1980

如何https在同一个域中配置多个端口?

默认配置:

<VirtualHost *:80>
               ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<VirtualHost *:443>

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        ServerName example.com
        SSLEngine on
        SSLCertificateFile /home/ubuntu/ssl_cert/signed_cert.crt
        SSLCertificateKeyFile /home/ubuntu/ssl_cert/server.key

</VirtualHost>

端口.conf:

Listen 80

<IfModule ssl_module>
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>
debian https
  • 1 个回答
  • 9452 Views
Martin Hope
Naftuli Kay
Asked: 2019-02-15 10:15:58 +0800 CST

具有通过 HTTPS 下载功能的 PGP 密钥服务器?

  • 5

我公司的防火墙阻止了端口 80 上的密钥服务器,而我希望支持的一些发行版还没有使用 HKPS 来通过 TLS 获取。

是否有密钥服务器可以通过 HTTPS 提供给定密钥的简单下载?例如,我可以在https://keybase.io/naftulikay/pgp_keys.asc的 keybase 上获取我自己的个人密钥

是否有资源可以在不使用密钥服务器协议的情况下通过 HTTPS 获取密钥?我正在编写 Ansible,因此很容易通过 HTTPS 获取内容。

https pgp
  • 1 个回答
  • 877 Views
Martin Hope
Jan Kaifer
Asked: 2018-09-04 11:47:10 +0800 CST

OpenBSD 通过使用 relayd 或 pf 的域重定向 HTTPS

  • 1

我有一台具有多个域的机器,我正在尝试在其上运行多个 HTTPS Web 服务器。所有的 Web 服务器都支持 https,所以我只需要将传入的数据包重定向到适当的端口(每个域都有一个端口)。我没有找到任何不需要中继才能访问 https 证书和密钥的东西。而且 man 说 relayd 不支持这个(只有客户端 tls 模式,服务器 tls 模式或两者,没有“重定向”或“通过”)。感谢您提供任何建议、建议或只是在哪里寻找解决方案的方向。

openbsd https
  • 1 个回答
  • 863 Views
Martin Hope
l0b0
Asked: 2018-06-22 15:20:02 +0800 CST

如何在 cURL 命令行中信任自签名证书?

  • 56

我使用Let's Encrypt 推荐使用这个 Makefile为 foo.localhost 创建了一个自签名证书:

include ../.env

configuration = csr.cnf
certificate = self-signed.crt
key = self-signed.key

.PHONY: all
all: $(certificate)

$(certificate): $(configuration)
    openssl req -x509 -out $@ -keyout $(key) -newkey rsa:2048 -nodes -sha256 -subj '/CN=$(HOSTNAME)' -extensions EXT -config $(configuration)

$(configuration):
    printf "[dn]\nCN=$(HOSTNAME)\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:$(HOSTNAME)\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth" > $@

.PHONY: clean
clean:
    $(RM) $(configuration)

然后,我将其分配给 Web 服务器。我已验证服务器返回相关证书:

$ openssl s_client -showcerts -connect foo.localhost:8443 < /dev/null
CONNECTED(00000003)
depth=0 CN = foo.localhost
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 CN = foo.localhost
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
 0 s:/CN=foo.localhost
   i:/CN=foo.localhost
-----BEGIN CERTIFICATE-----
[…]
-----END CERTIFICATE-----
---
Server certificate
subject=/CN=foo.localhost
issuer=/CN=foo.localhost
---
No client certificate CA names sent
Peer signing digest: SHA512
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 1330 bytes and written 269 bytes
Verification error: unable to verify the first certificate
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256
    Session-ID: […]
    Session-ID-ctx: 
    Master-Key: […]
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket:
    […]

    Start Time: 1529622990
    Timeout   : 7200 (sec)
    Verify return code: 21 (unable to verify the first certificate)
    Extended master secret: no
---
DONE

如何在不修改 /etc 中的任何内容的情况下让 cURL 信任它? --cacert不起作用,大概是因为没有CA :

$ curl --cacert tls/foo.localhost.crt 'https://foo.localhost:8443/'
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

目标是在开发过程中启用 HTTPS:

  • 如果没有在所有开发环境中启用 DNS 验证的大量工作,我就无法拥有完全类似于生产的证书。因此我必须使用自签名证书。
  • 我显然仍然想让我的开发环境尽可能地类似于生产环境,所以我不能简单地忽略任何和所有证书问题。curl -k就像catch (Exception e) {}在这种情况下一样 - 完全不像浏览器与 Web 服务器通信。

换句话说,当我跑步时,curl [something] https://project.local/api/foo我想确信

  1. 如果 TLS 配置正确,除了具有自签名证书,该命令将成功并且
  2. 如果我的 TLS 配置有任何问题,除了拥有自签名证书,该命令将失败。

使用 HTTP 或--insecure不符合第二个标准。

curl https
  • 7 个回答
  • 155357 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve