OpenVPN with official certificates
Posted: Mon Jan 05, 2015 2:25 pm
Hi all,
First of all, happy new year, wishing you as less bugs as possible for 2015 !
I decided to post here because I couldn't find an answer to my problem anywhere.
I would like to use an official certificate for all the services I host on my server, therefore I bought a wildcart from SSLS (comodo). It is working fine with all service but I can't run my ovpn server correctly with it.
I do have:
The certificate of the CA [ca.crt] (wich is a pem of SSLS and comodo certificates)
The private server key [server.key]
The server certificate [server.crt]
All are signed and valid !
I then generate a diffie hellman:
./build-dh keys/dh2048.pem
And the secret key for the SSL/TLS exchange:
openvpn --genkey --secret keys/ta.key
To me following configuration should be correct:
In server.conf file I have following content:
The server starts correctly and there are no errors in the log files...
But when I want to generate cert & key couple for a client with pkitool, I have following error:
Which is normal as I will never have the ca.key of comodo
(at least I hope not)
In this case what is the best to do ? Use my own server.key and server.crt as CA (ca.crt and ca.key) ?
But then, how do I generate a new key and cert couple signed by those ?
If you have any idea about the way to do this right, it will be a pleasure to try it out !
First of all, happy new year, wishing you as less bugs as possible for 2015 !
I decided to post here because I couldn't find an answer to my problem anywhere.
I would like to use an official certificate for all the services I host on my server, therefore I bought a wildcart from SSLS (comodo). It is working fine with all service but I can't run my ovpn server correctly with it.
I do have:
The certificate of the CA [ca.crt] (wich is a pem of SSLS and comodo certificates)
The private server key [server.key]
The server certificate [server.crt]
All are signed and valid !
I then generate a diffie hellman:
./build-dh keys/dh2048.pem
And the secret key for the SSL/TLS exchange:
openvpn --genkey --secret keys/ta.key
To me following configuration should be correct:
In server.conf file I have following content:
Code: Select all
# Interface options
dev tun
proto udp
# We mount the tunnel via this local L.L.L.L
local L.L.L.L
# Server should listen on port
port 1194
# The openvpn tunnel IP network (usually the server takes the first IP of the range hereunder and the clients the other IPs):
server 10.111.0.0 255.255.0.0
# Store couple client/IP for persistency
ifconfig-pool-persist ipp.txt
# The configuration that will be pushed to clients
# The default gw
push "redirect-gateway def1 bypass-dhcp"
# Route this network through server
push "route 10.111.0.0 255.255.0.0"
# DNS options
push "dhcp-option DNS 8.8.8.8"
# Allow different VPN clients to communicate together
client-to-client
# TLS mode enabled
tls-server
# Diffie-Hellman
dh keys/dh2048.pem
# Certificate Authority file
ca keys/ca.crt
# Server certificate
cert keys/server.crt
# Server private key
key keys/server.key
# TLS ta key (0 stand for server)
tls-auth keys/ta.key 0
# Persistent tunnel and key
persist-tun
persist-key
# Openvpn daemon user
user openvpn
group openvpn
# Watchdog of the VPN (ping every 10sec, if no response after 120sec assume peer as down)
keepalive 10 120
# Maximum number of authorized clients
max-clients 100
# Enables lzo compression
;comp-lzo
# Logging
status /var/log/openvpn-status.log
log /var/log/openvpn.log
# Log verbosity level
verb 3
# LDAP connector
username-as-common-name
plugin /usr/lib/openvpn/openvpn-auth-ldap.so /etc/openvpn/auth/auth-ldap.confBut when I want to generate cert & key couple for a client with pkitool, I have following error:
Code: Select all
pkitool: Need a readable ca.crt and ca.key in /etc/openvpn/key-generator/keys
Try pkitool --initca to build a root certificate/key.In this case what is the best to do ? Use my own server.key and server.crt as CA (ca.crt and ca.key) ?
But then, how do I generate a new key and cert couple signed by those ?
If you have any idea about the way to do this right, it will be a pleasure to try it out !