Arch-Linux

Gnome 網路管理器 OpenVPN

  • February 26, 2014

我無法讓 OpenVPN 與 GNOME NetworkManager 一起工作。

身份驗證類型是“證書 (TLS)”

我有 3 個文件:

  • 使用者證書:user.crt
  • CACert:ca.key
  • 私鑰:user.key

都住在我的主目錄中。連接失敗並顯示以下消息:

Feb 25 23:16:49 archpad nm-openvpn[1138]: OpenVPN 2.3.2 x86_64-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [eurephia] [MH] [IPv6
Feb 25 23:16:49 archpad nm-openvpn[1138]: WARNING: No server certificate verification method has been enabled.  See http://openvpn.n
Feb 25 23:16:49 archpad nm-openvpn[1138]: NOTE: the current --script-security setting may allow this configuration to call user-defi
Feb 25 23:16:49 archpad nm-openvpn[1138]: WARNING: file '/home/mak/Downloads/user.key' is group or others accessible
Feb 25 23:16:49 archpad nm-openvpn[1138]: Cannot load CA certificate file /home/mak/Downloads/ca.key (OpenSSL)
Feb 25 23:16:49 archpad nm-openvpn[1138]: Exiting due to fatal error
Feb 25 23:16:49 archpad NetworkManager[422]: <warn> VPN plugin failed: 1
Feb 25 23:16:49 archpad NetworkManager[422]: <info> VPN plugin state changed: stopped (6)
Feb 25 23:16:49 archpad NetworkManager[422]: <info> VPN plugin state change reason: 0
Feb 25 23:16:49 archpad NetworkManager[422]: <info> Policy set 'tb303' (wlp3s0) as default for IPv4 routing and DNS.
Feb 25 23:16:49 archpad NetworkManager[422]: <warn> error disconnecting VPN: Could not process the request because no VPN connection

更新

的輸出

openssl x509 -in  /home/mak/Downloads/ca.key -noout -text

unable to load certificate
140493069354640:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: TRUSTED CERTIFICATE

這是致命錯誤:

Cannot load CA certificate file /home/mak/Downloads/ca.key 

它可能無法載入密鑰有幾個原因:

  1. 權限不對。檢查以確保文件可讀
  2. 文件不存在。確認路徑和名稱正確。
  3. 文件格式錯誤,或者不是 CA 證書。嘗試openssl x509 -in /usr/local/share/ca-certificates/MetricsCA.crt -noout -text確保它吐出以“證書:”開頭的內容,目前日期/時間在有效期內,並且它具有“CA:TRUE”作為基本約束之一。

引用自:https://unix.stackexchange.com/questions/116933