2009-07-30 77 views
28

我目前正在使用LAMP堆棧在webproject上進行本地開發。由於我的生產應用程序將使用https登錄,因此我希望能夠在我的本地開發環境中模擬此操作,以便所有網址保持一致。我是新來的ssl證書所以任何人都可以請我指出一些參考如何做到這一點?我需要簽署我自己的證書嗎?我在哪裏放證書(我有使用Apache的虛擬主機配置)?謝謝。如何使用SSL爲本地開發創建證書?

回答

29

我是新來的,但去這個網站和信息有

Creating a self signed Certificate

+0

是的,這是我在設置SSL時用於創建自簽名的演練 – 2009-07-30 11:37:03

+0

這是一個非常好的分步指南。但即使這樣做了,我的瀏覽器仍然不斷抱怨安全。我正在使用Chrome版本50.0.2661.86(64位)。即使設置了所有的Apache後,它仍然顯示「隱私錯誤 - 您的連接不是私有的 - 攻擊者可能試圖從mysite.com竊取您的信息(例如,密碼,郵件或信用卡)。 ERR_CERT_AUTHORITY_INVALID」。我該怎麼辦? – 2016-04-28 23:51:57

0

你是最好的關閉使得自簽名證書並將其添加到您使用任何設備進行測試。它應該對客戶顯得「真實」......當然,這是真實的......只是不是由「可信」的地方。 (引號,因爲我發誓這是所有關於錢!)

我剛剛發現這個頁面,要加強你通過它

http://www.perturb.org/display/entry/754/

0

很明顯,因爲你使用的是Java和Apache這是不會有太大的好,但無論如何,如果你也做任何.Net開發你就會有這些工具可用,這也許可以幫助你在路上並實際生成證書。我使用的是.Net SDK中的makecert,這裏是我用來爲本地.Net開發和IIS創建自己的SSL證書的批處理文件;

@ECHO OFF 
REM 
REM This script will create a certificate to enable HTTPS for the localhost in IIS 
REM Complete the following steps to install the certificate 
REM 
REM 1. Run this file to create the certificate 
REM 2. Open MMC.exe 
REM 3. Click File > Add/Remove Snap In > Add and select 'Certificates' 
REM 4. Select 'Computer Account' 
REM 5. Select 'Local Computer' and click 'Finish', 'Close', 'OK' 
REM 6. Expand Certificates > Personal > Certificates, the new certificate should be listed 
REM 7. In IIS open the Properties of the Default Web Site 
REM 8. Select 'Directory Security' tab and click 'Server Certificate' 
REM 9. The Certificate Wizard will open, choose 'Assign Existing Certificate' [may  need to cancel a pending certificate request] 
REM 10. Select new certificate from list and accept change 
REM 11. Ensure that the site is using the default port for SSL 443 
REM 

C: 
CD \ 
CALL "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sdkvars.bat" 
ECHO Creating Certificate 
makecert -r -pe -n "CN=localhost" -b 01/01/2000 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 
PAUSE 

更改"CN=localhost"如果使用其他主機頭進入電影網站,你也許需要根據哪個版本的Visual Studio你有改變的CALL聲明的路徑。