From 5ebb6aeab6d059cbb3ead36466aeb1a5cf5b7a80 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 11 Dec 2002 15:50:47 +0000 Subject: [PATCH] Document openssl.cnf related issues, and add an example of how to act as a certificate authority using PHP. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@107656 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/openssl/configure.xml | 46 ++++++++++++++++++- .../openssl/functions/openssl-csr-new.xml | 6 ++- .../openssl/functions/openssl-csr-sign.xml | 39 +++++++++++++++- .../functions/openssl-pkey-export-to-file.xml | 3 +- .../openssl/functions/openssl-pkey-export.xml | 3 +- .../openssl/functions/openssl-pkey-new.xml | 3 +- reference/openssl/note-openssl-cnf.xml | 8 ++++ 7 files changed, 101 insertions(+), 7 deletions(-) create mode 100644 reference/openssl/note-openssl-cnf.xml diff --git a/reference/openssl/configure.xml b/reference/openssl/configure.xml index f35ef35cbd..1ecb19bc7a 100644 --- a/reference/openssl/configure.xml +++ b/reference/openssl/configure.xml @@ -1,5 +1,5 @@ - +
&reftitle.install; @@ -14,6 +14,50 @@ package to the SYSTEM32 folder of your windows machine. (Ex: C:\WINNT\SYSTEM32 or C:\WINDOWS\SYSTEM32) + + Additionally, if you are planning to use the key generation and certificate + signing functions, you will need to install a valid + openssl.cnf on your system. As of PHP 4.3.0, we + include a sample configuration file in the openssl of + our win32 binary distribution. If you are using PHP 4.2.0 or later and are + missing the file, you can obtain it from the + OpenSSL home page or by downloading the PHP 4.3.0 release and using + the configuration file from there. + + + PHP will search for the openssl.cnf using the + following logic: + + + the OPENSSL_CONF environmental variable, if + set, will be used as the path (including filename) of the configuration + file. + + + + the SSLEAY_CONF environmental variable, if + set, will be used as the path (including filename) of the configuration + file. + + + + The file openssl.cnf will be assumed to be + found in the default certificate area, as configured at the time that + the openssl DLL was compiled. This is usually means that the default + filename is c:\usr\local\ssl\openssl.cnf. + + + + + + In your installation, you need to decide whether to install the + configuration file at c:\usr\local\ssl\openssl.cnf or + whether to install it someplace else and use environmental variables + (possibly on a per-virtual-host basis) to locate the configuration file. + Note that it is possible to override the default path from the script using + the configargs of the functions that require a + configuration file. +
diff --git a/reference/openssl/functions/openssl-csr-new.xml b/reference/openssl/functions/openssl-csr-new.xml index f9724ecbf9..91c4e9d08c 100644 --- a/reference/openssl/functions/openssl-csr-new.xml +++ b/reference/openssl/functions/openssl-csr-new.xml @@ -1,5 +1,5 @@ - + @@ -33,6 +33,7 @@ extraattribs are associative arrays whose keys are converted to OIDs and applied to the relevant part of the request. + &reference.openssl.note-openssl-cnf; By default, the information in your system openssl.conf is used to initialize the request; you can specify a configuration file @@ -109,7 +110,8 @@ - <function>openssl_csr_new</function> example + <function>openssl_csr_new</function> example - creating a + self-signed-certificate - + @@ -33,6 +33,43 @@ Returns an x509 certificate resource on success, &false; on failure. + &reference.openssl.note-openssl-cnf; + + + <function>openssl_csr_sign</function> example - signing a + CSR (how to implement your own CA) + + + + + + diff --git a/reference/openssl/functions/openssl-pkey-export-to-file.xml b/reference/openssl/functions/openssl-pkey-export-to-file.xml index 6e1b8213eb..cf68148525 100644 --- a/reference/openssl/functions/openssl-pkey-export-to-file.xml +++ b/reference/openssl/functions/openssl-pkey-export-to-file.xml @@ -1,5 +1,5 @@ - + @@ -26,6 +26,7 @@ information about configargs. &return.success; + &reference.openssl.note-openssl-cnf; diff --git a/reference/openssl/functions/openssl-pkey-export.xml b/reference/openssl/functions/openssl-pkey-export.xml index f6b332759b..50fd20a994 100644 --- a/reference/openssl/functions/openssl-pkey-export.xml +++ b/reference/openssl/functions/openssl-pkey-export.xml @@ -1,5 +1,5 @@ - + @@ -26,6 +26,7 @@ information about configargs. &return.success; + &reference.openssl.note-openssl-cnf; diff --git a/reference/openssl/functions/openssl-pkey-new.xml b/reference/openssl/functions/openssl-pkey-new.xml index 8073667c02..7d122bf207 100644 --- a/reference/openssl/functions/openssl-pkey-new.xml +++ b/reference/openssl/functions/openssl-pkey-new.xml @@ -1,5 +1,5 @@ - + @@ -21,6 +21,7 @@ openssl_csr_new for more information about configargs. + &reference.openssl.note-openssl-cnf; diff --git a/reference/openssl/note-openssl-cnf.xml b/reference/openssl/note-openssl-cnf.xml new file mode 100644 index 0000000000..71d0f8c8bb --- /dev/null +++ b/reference/openssl/note-openssl-cnf.xml @@ -0,0 +1,8 @@ + + + You need to have a valid openssl.cnf installed for + this function to operate correctly. + See the notes under for more + information. + +