1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
7 Configuration of Certificates in test environment(For FTP over TLS):
9 DFC supports two protocols: FTPES and SFTP.
10 For FTPES, it is mutual authentication with certificates.
11 In our test environment, we use vsftpd to simulate xNF, and we generate self-signed
12 keys & certificates on both vsftpd server and DFC.
14 1. Generate key/certificate with openssl for DFC:
15 -------------------------------------------------
18 openssl genrsa -out dfc.key 2048
19 openssl req -new -out dfc.csr -key dfc.key
20 openssl x509 -req -days 365 -in dfc.csr -signkey dfc.key -out dfc.crt
22 2. Generate key & certificate with openssl for vsftpd:
23 ------------------------------------------------------
26 openssl genrsa -out ftp.key 2048
27 openssl req -new -out ftp.csr -key ftp.key
28 openssl x509 -req -days 365 -in ftp.csr -signkey ftp.key -out ftp.crt
30 3. Configure java keystore in DFC:
31 ----------------------------------
32 We have two keystore files, one for TrustManager, one for KeyManager.
36 1. First, convert your certificate in a DER format :
40 openssl x509 -outform der -in ftp.crt -out ftp.der
42 2. And after, import it in the keystore :
46 keytool -import -alias ftp -keystore ftp.jks -file ftp.der
50 1. First, create a jks keystore:
54 keytool -keystore dfc.jks -genkey -alias dfc
56 2. Second, import dfc.crt and dfc.key to dfc.jks. This is a bit troublesome.
58 1). Step one: Convert x509 Cert and Key to a pkcs12 file
62 openssl pkcs12 -export -in dfc.crt -inkey dfc.key -out dfc.p12 -name [some-alias]
64 Note: Make sure you put a password on the p12 file - otherwise you'll get a null reference exception when you try to import it.
66 Note 2: You might want to add the -chainoption to preserve the full certificate chain.
68 2). Step two: Convert the pkcs12 file to a java keystore:
72 keytool -importkeystore -deststorepass [changeit] -destkeypass [changeit] -destkeystore dfc.jks -srckeystore dfc.p12 -srcstoretype PKCS12 -srcstorepass [some-password] -alias [some-alias]
78 update /etc/vsftpd/vsftpd.conf:
82 rsa_cert_file=/etc/ssl/private/ftp.crt
83 rsa_private_key_file=/etc/ssl/private/ftp.key
86 force_local_data_ssl=YES
87 force_local_logins_ssl=YES
98 ca_certs_file=/home/vsftpd/myuser/dfc.crt
100 5. Configure config/datafile_endpoints.json:
101 --------------------------------------------
102 Update the file accordingly:
104 .. code-block:: javascript
106 "ftpesConfiguration": {
107 "keyCert": "/config/dfc.jks",
108 "keyPassword": "[yourpassword]",
109 "trustedCA": "/config/ftp.jks",
110 "trustedCAPassword": "[yourpassword]"
113 6. This has been tested with vsftpd and dfc, with self-signed certificates.
114 ---------------------------------------------------------------------------
115 In real deployment, we should use ONAP-CA signed certificate for DFC, and vendor-CA signed certificate for xNF