這里只是做一個(gè)phpstudy的配置回顧,因?yàn)槲乙彩桥渲贸晒χ蠡仡^來梳理一下,有的細(xì)節(jié)可能忘掉了,盡量弄詳細(xì)一些!
phpStudy是一個(gè)PHP調(diào)試環(huán)境的程序集成包。
該程序包集成最新的Apache+PHP+MySQL+NIGINX+phpMyAdmin+ZendOptimizer,一次性安裝,無須配置即可使用,是非常方便、好用的PHP調(diào)試環(huán)境.該程序不僅包括PHP調(diào)試環(huán)境,還包括了數(shù)據(jù)庫、開發(fā)工具、開發(fā)手冊(cè)等.。同時(shí)phpStudy還自帶有openssl工具(我們證書生成所要用到的);
下載地址:http://phpstudy.php.cn/

解壓后的客戶端
正常啟動(dòng)后的客戶端:

默認(rèn)的服務(wù)器應(yīng)該是php+apache,因?yàn)閍pache的雙向驗(yàn)證資料太少所以我選擇了用nginx服務(wù)器:

切換NGINX服務(wù)器
服務(wù)器切換完畢之后,打開vhosts文件

打開vhosts
簡(jiǎn)單的服務(wù)器配置:
server {
listen 443 ssl; #http的端口號(hào)是80,https的端口為443
server_name www.test.com #服務(wù)器域名 配置多個(gè)時(shí)不要添加;號(hào)即可
ServerName 127.0.0.1
ServerName 192.168.0.111; #本機(jī)電腦的ip地址
ssl on; #開啟ssl
ssl_certificate C:\Users\Administrator\Desktop\ssl4\server.cer; #服務(wù)器證書文件
ssl_certificate_key C:\Users\Administrator\Desktop\ssl4\server.key; #服務(wù)器證書密匙
ssl_client_certificate C:\Users\Administrator\Desktop\ssl4\ca.cer; #根證書
ssl_verify_depth 1; #這里不是必須的,好像是根證書層級(jí)!
ssl_verify_client on; #開啟客戶端驗(yàn)證
location / {
root F:\PHPStudy\PHPTutorial\WWW; #本地網(wǎng)站文件目錄
index index.HTML index.html index.htm ;
}
}
html本地文件的路徑會(huì)有差異,自己配置一下應(yīng)該不難!

html路徑
html里面的內(nèi)容:
<html>
<head><title>測(cè)試Demo</title></head>
<body bgcolor="white">
<center><h1>測(cè)試</h1></center>
<center>123456</center>
<hr><center>aaa</center>
</body>
</html>
打開phpstudy自帶的openssl工具,在后面證書生成的時(shí)候需要:

openssl工具
到這里基本上就已經(jīng)配置完了,還是比較簡(jiǎn)單的!
正常狀態(tài)的話下面2個(gè)圓點(diǎn)都是綠色的,紅色的話說明是哪里配置錯(cuò)誤了,因?yàn)楝F(xiàn)在端口號(hào)配置的是https所以本地是打不開的 !其他的可以自己百度一下其他資料,也可以查看一下PHPStudy\PHPTutorial\nginx\logs目錄下的成功或者錯(cuò)誤日志!

image.png
各類知識(shí)點(diǎn)整理:
- android https雙向驗(yàn)證 前言及總結(jié):http://www.itdecent.cn/p/07ce321d80ab
- 單雙向驗(yàn)證基礎(chǔ)知識(shí)點(diǎn): http://www.itdecent.cn/p/ea5f4b1d9c00
- 瀏覽器獲取證書文件(p12轉(zhuǎn)cer):http://www.itdecent.cn/p/7f74acab6c74
- https雙向認(rèn)證證書生成:http://www.itdecent.cn/p/094c7fc8cb85
- android okhttps雙向驗(yàn)證(代碼實(shí)現(xiàn)):http://www.itdecent.cn/p/6229d10d3550
- android webView的雙向驗(yàn)證:http://www.itdecent.cn/p/e98119d04fd9
- 配置完成后的測(cè)試:http://www.itdecent.cn/p/cfcf708a591a
- Glide okhttps證書驗(yàn)證全局配置:http://www.itdecent.cn/p/ac0b5c5f3ca7
工具類:
- P12證書轉(zhuǎn)BKS證書:http://www.itdecent.cn/p/2a96c36b27fe
- 服務(wù)器網(wǎng)址檢測(cè)(兼容性及協(xié)議檢測(cè)):https://www.ssllabs.com/index.html