请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
头像
20sanguo
帖子: 794
注册时间: 2008-05-10 9:53

请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#1

帖子 20sanguo » 2017-10-07 19:42

nginx能简单实现这个功能么?能的话我就研究研究不能的话apache行吗?

客户端获得证书就导入到本地才能正常访问该网站下任何网页,没有的自动给他转到个其它主页去。

并且,证书每个客户发不同的,如果需要服务器这边简单设置就可以拒绝某一证书登陆,其他主页去吧。

谢谢。
头像
20sanguo
帖子: 794
注册时间: 2008-05-10 9:53

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#2

帖子 20sanguo » 2017-10-08 0:26

nginx可以客户证书访问。
拒绝访问我再研究研究,另外error page 400 404 = http://其它网址 好像不行啊。
头像
20sanguo
帖子: 794
注册时间: 2008-05-10 9:53

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#3

帖子 20sanguo » 2017-10-08 9:25

客户端如果不用证书显示这个,能让他跳转到其它网址吗?而不显示详细错误。

代码: 全选

400 Bad Request

No required SSL certificate was sent

404是可以正确跳转的,配置文件如下

代码: 全选

fastcgi_intercept_errors on;
        proxy_intercept_errors on;
        error_page 400 http://www.123/;
        error_page 404 http://www.123/;

        # redirect server error pages to the static page /50x.html

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                proxy_pass http://www.123/;
                #root /usr/share/nginx/html;
        }
头像
20sanguo
帖子: 794
注册时间: 2008-05-10 9:53

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#4

帖子 20sanguo » 2017-10-08 9:54

注销用户证书就这样。现在就差400错误啦 :Haha

代码: 全选

命令openssl ca -revoke 注销证书.pem

配置  ssl_crl \..\..\ca.crl\

命令openssl ca -gencrl -crldays 30 -out ca.crl
每次变动都要重启nginx服务才生效?
头像
20sanguo
帖子: 794
注册时间: 2008-05-10 9:53

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#5

帖子 20sanguo » 2017-10-08 10:33

原来根本不是400.这很难捉摸啊。另外单证书只能单用户访问是哪个选项啊?

代码: 全选

495
an error has occurred during the client certificate verification;
496
a client has not presented the required certificate;
497
a regular request has been sent to the HTTPS port.
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#6

帖子 poloshiao » 2017-10-08 11:07

No required SSL certificate was sent
1. 參閱
1-1. https://help.ubuntu.com/16.04/servergui ... urity.html
Certificates
1-2. http://tldp.org/HOWTO/SSL-Certificates-HOWTO/x246.html
Using a certificate with mod_ssl in apache
1-3. http://tldp.org/HOWTO/SSL-Certificates-HOWTO/x195.html
Certificate management
nginx能简单实现这个功能么?
2. https://www.digicert.com/ssl-certificat ... -nginx.htm
Nginx SSL Certificate Installation
客户端证书
3. SSL certificate exception
3-1. https://support.mozilla.org/zh-TW/questions/1076086
Manually add certificate exception
3-2. https://support.mozilla.org/zh-TW/questions/1131961
SSL certificate exception impossible to add any more
头像
20sanguo
帖子: 794
注册时间: 2008-05-10 9:53

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#7

帖子 20sanguo » 2017-10-08 11:21

谢谢,现在发销证书、400跳转都已经搞定了。 就差怎样实现限制单证书只能单用户访问了。
poloshiao 写了:
No required SSL certificate was sent
1. 參閱
1-1. https://help.ubuntu.com/16.04/servergui ... urity.html
Certificates
1-2. http://tldp.org/HOWTO/SSL-Certificates-HOWTO/x246.html
Using a certificate with mod_ssl in apache
1-3. http://tldp.org/HOWTO/SSL-Certificates-HOWTO/x195.html
Certificate management
nginx能简单实现这个功能么?
2. https://www.digicert.com/ssl-certificat ... -nginx.htm
Nginx SSL Certificate Installation
客户端证书
3. SSL certificate exception
3-1. https://support.mozilla.org/zh-TW/questions/1076086
Manually add certificate exception
3-2. https://support.mozilla.org/zh-TW/questions/1131961
SSL certificate exception impossible to add any more
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#8

帖子 poloshiao » 2017-10-08 11:30

限制单证书只能单用户访问
請詳細描述
头像
20sanguo
帖子: 794
注册时间: 2008-05-10 9:53

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#9

帖子 20sanguo » 2017-10-08 11:34

poloshiao 写了:
限制单证书只能单用户访问
請詳細描述
我给张三发了证书A,他如果给了李四。我需要限制张三李四不能同时登陆,或者限制只能张三用这个证书。
李四想登陆只能找我申请证书B。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#10

帖子 poloshiao » 2017-10-08 13:52

我给张三发了证书A,他如果给了李四。我需要限制张三李四不能同时登陆,或者限制只能张三用这个证书。
李四想登陆只能找我申请证书B。
這個概念 跟證書概念不同
https://help.ubuntu.com/16.04/servergui ... rtificates
Types of Certificates

不過 看看 這一篇 能否幫你 (這是 Learn-Wise)
https://support.magnifigroup.com/hc/en- ... or-a-User-
Can I generate a credentialing certificate for a User?
头像
20sanguo
帖子: 794
注册时间: 2008-05-10 9:53

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#11

帖子 20sanguo » 2017-10-08 14:27

第二篇应该是介绍他的系统功能吧。看起来可能要从nginx外下手才能实现了,也没有头绪啊。
poloshiao 写了: 這個概念 跟證書概念不同
https://help.ubuntu.com/16.04/servergui ... rtificates
Types of Certificates

不過 看看 這一篇 能否幫你 (這是 Learn-Wise)
https://support.magnifigroup.com/hc/en- ... or-a-User-
Can I generate a credentialing certificate for a User?
头像
20sanguo
帖子: 794
注册时间: 2008-05-10 9:53

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#12

帖子 20sanguo » 2017-10-08 20:54

我现在考虑着 $ssl_client_i_dn 获取客户端的cn还有 其他信息,放到mysql的表里,然后登陆一个轮一遍,应该不影响啥性能吧,还是放到临时文件里轮。问题是无论是临时文件还是mysql抑或nginx取值我都不会啊。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#13

帖子 poloshiao » 2017-10-09 11:40

我现在考虑着 $ssl_client_i_dn 获取客户端的cn还有 其他信息,放到mysql的表里
问题是无论是临时文件还是mysql取值我都不会啊。
1. https://help.ubuntu.com/16.04/serverguide/mysql.html
MySQL

2. https://help.ubuntu.com/16.04/servergui ... admin.html
phpMyAdmin
phpMyAdmin is a LAMP application specifically written for administering MySQL servers. Written in PHP, and accessed through a web browser, phpMyAdmin provides a graphical interface for database administration tasks.
2-1. 使用 phpMyadmin 有 Web 圖形界面 讓你很容易 創設/管理 儲存在 MySQL 數據庫 的表格
头像
20sanguo
帖子: 794
注册时间: 2008-05-10 9:53

Re: 请问客户端需要我给的证书才能访问我的网站用哪个web服务比较好

#14

帖子 20sanguo » 2017-10-10 10:52

谢谢,我研究研究。
poloshiao 写了: 1. https://help.ubuntu.com/16.04/serverguide/mysql.html
MySQL

2. https://help.ubuntu.com/16.04/servergui ... admin.html
phpMyAdmin
phpMyAdmin is a LAMP application specifically written for administering MySQL servers. Written in PHP, and accessed through a web browser, phpMyAdmin provides a graphical interface for database administration tasks.
2-1. 使用 phpMyadmin 有 Web 圖形界面 讓你很容易 創設/管理 儲存在 MySQL 數據庫 的表格
回复