Auteur Topic: Certificaat, en automatisch starten  (gelezen 1705 keer)

Offline SiJoNas

  • Bedankjes
  • -Gegeven: 0
  • -Ontvangen: 4
  • Berichten: 84
Certificaat, en automatisch starten
« Gepost op: 05 januari 2019, 10:39:24 »
Beste mensen,

Twee vragen over mijn openvpn:

1. Op mijn android telefoon blijft OpenVPN Connect vragen om een certificaat. Ik heb geprobeerd om verschillende certificaten te installeren maar het helpt niet. Na klikken op Continue wordt er wel een verbinding gemaakt. Welk certificaat moet ik waar installeren, en moet ik dit ergens in de .ovpn aangeven? Overigens vraagt mijn windows er niet om (met dezelfde .ovpn).

2. Hoe kan ik zowel mijn windows laptop als mijn telefoon zo instellen dat de vpn automatisch start, wanneer ik mijn (veilige) thuisnetwerk verlaat? En dan uiteraard ook omgekeerd: dat de vpn uitgeschakeld wordt als ik weer thuis ben.

Voor de duidelijkheid: niet alleen het programma/appje OpenVPN moet gestart worden, maar het bijbehorende profiel dus ook, anders heeft het geen zin.
DS214+, altijd up-to-date DSM
2 x 3TB WD30EFRX, Raid1
1 x 3TB WD30EFRX in Quickport voor onsite Backup
1 x C2 voor offsite Backup

Offline Briolet

  • Global Moderator
  • MVP
  • *
  • Bedankjes
  • -Gegeven: 177
  • -Ontvangen: 2629
  • Berichten: 16.288
Re: Certificaat, en automatisch starten
« Reactie #1 Gepost op: 05 januari 2019, 11:28:09 »
In het .ovpn  bestand kan een verwijzing staan naar een extern certificaat, of het certificaat is onderdeel van het .ovpn bestand. Welk van de twee zou je eigenlijk moeten weten als je dat bestand bekijkt.

Bij mij was het vroeger het eerste en tegenwoordig het laatste. Maar die verandering kan ook aan mijn instellingen liggen. In elk geval moet je in het .ovpn bestand kijken.
  • Mijn Synology: DS415+
  • HDD's: 3x 3TB in SHR
  • Extra's: DS212J, RT1900ac

Offline SiJoNas

  • Bedankjes
  • -Gegeven: 0
  • -Ontvangen: 4
  • Berichten: 84
Re: Certificaat, en automatisch starten
« Reactie #2 Gepost op: 05 januari 2019, 13:48:44 »
Dit is mijn ovpn bestand, bijna standaard zoals die door de nas gemaakt wordt. Kan je hier iets aan ontdekken?

dev tun
tls-client
remote-cert-tls server
auth-nocache

remote www.###.eu 1194

# The "float" tells OpenVPN to accept authenticated packets from any address,
# not only the address which was specified in the --remote option.
# This is useful when you are connecting to a peer which holds a dynamic address
# such as a dial-in user or DHCP client.
# (Please refer to the manual of OpenVPN for more information.)

#float

# If redirect-gateway is enabled, the client will redirect it's
# default network gateway through the VPN.
# It means the VPN connection will firstly connect to the VPN Server
# and then to the internet.
# (Please refer to the manual of OpenVPN for more information.)

redirect-gateway def1

# dhcp-option DNS: To set primary domain name server address.
# Repeat this option to set secondary DNS server addresses.

# dhcp-option DNS 1.1.1.1

pull

# If you want to connect by Server's IPv6 address, you should use
# "proto udp6" in UDP mode or "proto tcp6-client" in TCP mode
proto udp

script-security 2


comp-lzo

reneg-sec 0

cipher AES-256-CBC

auth SHA512

auth-user-pass
<ca>
-----BEGIN CERTIFICATE-----
MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB
...
0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB
NVOFBkpdn627G190
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIGCDCCA/CgAwIBAgIQKy5u6tl1NmwUim7bo3yMBzANBgkqhkiG9w0BAQwFADCB
...
lBlGGSW4gNfL1IYoakRwJiNiqZ+Gb7+6kHDSVneFeO/qJakXzlByjAA6quPbYzSf
+AZxAeKCINT+b72x
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFdDCCBFygAwIBAgIQJ2buVutJ846r13Ci/ITeIjANBgkqhkiG9w0BAQwFADBv
...
PUsE2JOAWVrgQSQdso8VYFhH2+9uRv0V9dlfmrPb2LjkQLPNlzmuhbsdjrzch5vR
pu/xO28QOG8=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
...
mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
-----END CERTIFICATE-----
</ca>

DS214+, altijd up-to-date DSM
2 x 3TB WD30EFRX, Raid1
1 x 3TB WD30EFRX in Quickport voor onsite Backup
1 x C2 voor offsite Backup

Offline Briolet

  • Global Moderator
  • MVP
  • *
  • Bedankjes
  • -Gegeven: 177
  • -Ontvangen: 2629
  • Berichten: 16.288
Re: Certificaat, en automatisch starten
« Reactie #3 Gepost op: 05 januari 2019, 14:07:07 »
Het certificaat staat dus in het bestand.

Dan is het de OpenVPN client op je telefoon die niet weet hoe hij daar mee moet omgaan.  Volgens mij zien op dit forum wel instructies geplaatst hoe je OpenVPN op je telefoon moet instellen.

Ik snap alleen niet waarom er in jouw bestand 4 certificaten staan. Ik heb er maar 1 in staan. En je kunt in dsm ook maar 1 certificaat aan OpenVPN koppelen.

Wel jammer dat het readme bestand van synology alleen instructies voor Windows/Mac/Linux bevat en niet voor Android/iOS
  • Mijn Synology: DS415+
  • HDD's: 3x 3TB in SHR
  • Extra's: DS212J, RT1900ac

Offline Birdy

  • Global Moderator
  • MVP
  • *
  • Bedankjes
  • -Gegeven: 1342
  • -Ontvangen: 7805
  • Berichten: 43.224
  • FIFO / LIFO
    • Truebase
Re: Certificaat, en automatisch starten
« Reactie #4 Gepost op: 05 januari 2019, 15:35:55 »
Ik draai OpenVPN op m'n Synology Router en mijn VPNConfig.ovpn (export) zie er standaard zo uit:

dev tun
tls-client

remote YOUR_SERVER_IP 1194

# The "float" tells OpenVPN to accept authenticated packets from any address,
# not only the address which was specified in the --remote option.
# This is useful when you are connecting to a peer which holds a dynamic address
# such as a dial-in user or DHCP client.
# (Please refer to the manual of OpenVPN for more information.)

#float

# If redirect-gateway is enabled, the client will redirect it's
# default network gateway through the VPN.
# It means the VPN connection will firstly connect to the VPN Server
# and then to the internet.
# (Please refer to the manual of OpenVPN for more information.)

#redirect-gateway def1

# dhcp-option DNS: To set primary domain name server address.
# Repeat this option to set secondary DNS server addresses.

#dhcp-option DNS DNS_IP_ADDRESS

pull

# If you want to connect by Server's IPv6 address, you should use
# "proto udp6" in UDP mode or "proto tcp6-client" in TCP mode
proto udp

script-security 2


reneg-sec 0

auth SHA512

cipher AES-256-CBC

auth-user-pass


key-direction 1

comp-lzo
explicit-exit-notify
<ca>

-----BEGIN CERTIFICATE-----
MIIEJTCCAw2gAwIBAgIJAPjRCKWBZspaMA0GCSqGSIb3DQEBCwUAMIGUMQswCQYD
ENZ................................
-----END CERTIFICATE-----
</ca>

<tls-auth>

#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
0f05094d83d651ebe19e23104a3db8da
ENZ................................
-----END OpenVPN Static key V1-----
</tls-auth>

Deze heb ik geïmporteerd (na wat aanpassingen) op m'n Android app "OpenVPN voor Android"


CS406      DSM 2.0-0731    DS508      DSM 4.0-2265      DS411+II  DSM 6.2.4-25556-7   DS115J    DSM 7.1.1-42962-5   DS918+    DSM 6.2.4-25556-7
DS107+     DSM 3.1-1639    DS411slim  DSM 6.2.4-25556   DS213J    DSM 6.2.3-25426-2   DS1515+   DSM 6.2.4-25556-7   DS220+    DSM 7.2.1-69057-5
DS107+     DSM 3.1-1639    DS111      DSM 5.2-5967-9    DS413J    DSM 6.2.3-25426-2   DS716+II  DSM 6.2.4-25556-7   RT2600ac  SRM 1.2.5-8227-11
BeeDrive   1TB             BeeServer  BSM 1.0-65162                                                                 MR2200ac  SRM 1.2.5-8227-11

Offline SiJoNas

  • Bedankjes
  • -Gegeven: 0
  • -Ontvangen: 4
  • Berichten: 84
Re: Certificaat, en automatisch starten
« Reactie #5 Gepost op: 05 januari 2019, 16:21:27 »
Nou, voor het certificaat probleem heb ik een oplossing: voeg setenv CLIENT_CERT 0 toe aan het .ovpn bestand - en dat werkt! Wat daarvan de gevolgen zijn voor bijv. de encryptie, zoek ik nog wel eens uit maar vooralsnog ben ik geholpen.

Oplossing komt hier vandaan: klik hier

Blijft nu nog open: het automatisch starten......
DS214+, altijd up-to-date DSM
2 x 3TB WD30EFRX, Raid1
1 x 3TB WD30EFRX in Quickport voor onsite Backup
1 x C2 voor offsite Backup

Offline Briolet

  • Global Moderator
  • MVP
  • *
  • Bedankjes
  • -Gegeven: 177
  • -Ontvangen: 2629
  • Berichten: 16.288
Re: Certificaat, en automatisch starten
« Reactie #6 Gepost op: 05 januari 2019, 16:39:40 »
…Wat daarvan de gevolgen zijn voor bijv. de encryptie, zoek ik nog wel eens uit…

Maakt volgens mij niets uit. Ik lees:
Citaat van: link
This is necessary to resolve an ambiguity when the profile contains no client certificate or key, because otherwise the client app can't know whether an external certificate/key pair should be obtained from the Keychain, or whether the server actually doesn't require a client certificate/key. The option is given as a "setenv" to avoid breaking other OpenVPN clients that might not recognize it.
Het heeft alleen eenduidig aan dat je dat certificaat niet gebruikt.
  • Mijn Synology: DS415+
  • HDD's: 3x 3TB in SHR
  • Extra's: DS212J, RT1900ac


 

Cloudstation niet meer bereikbaar na nieuw certificaat

Gestart door rvldjBoard Cloud Station & Drive

Reacties: 3
Gelezen: 1013
Laatste bericht 23 juli 2020, 16:46:57
door wbree
VPn server certificaat genereren gaat niet goed

Gestart door deeptrapBoard VPN Server

Reacties: 0
Gelezen: 1865
Laatste bericht 29 december 2013, 22:47:40
door deeptrap
Certificaat error met link naar Album

Gestart door HHGDBoard Synology DSM algemeen

Reacties: 9
Gelezen: 3819
Laatste bericht 24 november 2015, 10:29:25
door Briolet
VERPLAATST: Kan geen Let's Encrypt Certificaat maken in DSM6.2.

Gestart door BirdyBoard Netwerk algemeen

Reacties: 0
Gelezen: 873
Laatste bericht 07 oktober 2018, 21:06:45
door Birdy
Let's encrypt certificaat probleem

Gestart door Forum026Board Synology DSM 6.1

Reacties: 4
Gelezen: 2731
Laatste bericht 31 juli 2017, 22:41:28
door Birdy