473,765 Members | 2,035 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

openssl_csr_new () not working... getting a 404 error !

Hi !

I am currently changing the server for my website, and i make a heavy
use of openssl functions.

Both servers use PHP4.3.3 with OpenSSL 0.9.6i.

I was actually testing with this code, taken out from PHP's
documentation :

<?php
// Fill in data for the distinguished name to be used in the cert
// You must change the values of these keys to match your name and
// company, or more precisely, the name and company of the person/site
// that you are generating the certificate for.
// For SSL certificates, the commonName is usually the domain name of
// that will be using the certificate, but for S/MIME certificates,
// the commonName will be the name of the individual who will use the
// certificate.
$dn = array(
"countryNam e" => "UK",
"stateOrProvinc eName" => "Somerset",
"localityNa me" => "Glastonbur y",
"organizationNa me" => "The Brain Room Limited",
"organizational UnitName" => "PHP Documentation Team",
"commonName " => "Wez Furlong",
"emailAddre ss" => "we*@php.ne t"
);

// Generate a new private (and public) key pair
$privkey = openssl_pkey_ne w();

// Generate a certificate signing request
$csr = openssl_csr_new ($dn, $privkey);

// You will usually want to create a self-signed certificate at this
// point until your CA fulfills your request.
// This creates a self-signed cert that is valid for 365 days
$sscert = openssl_csr_sig n($csr, null, $privkey, 365);

// Now you will want to preserve your private key, CSR and self-signed
// cert so that they can be installed into your web server, mail
server
// or mail client (depending on the intended use of the certificate).
// This example shows how to get those things into variables, but you
// can also store them directly into files.
// Typically, you will send the CSR on to your CA who will then issue
// you with the "real" certificate.
openssl_csr_exp ort($csr, $csrout) and debug_zval_dump ($csrout);
openssl_x509_ex port($sscert, $certout) and debug_zval_dump ($certout);
openssl_pkey_ex port($privkey, $pkeyout, "mypassword ") and
debug_zval_dump ($pkeyout);

// Show any errors that occurred here
while (($e = openssl_error_s tring()) !== false) {
echo $e . "\n";
}
?>

It is working perfectly fine on my previous server ( as it should).
However, not on the new server.

What is strange is I am not getting any error return. Just a plain
"Page not found" error. The error occurs whenever I put a
openssl_csr_new () call in my page. I can generate private key
flawlessly, but not generate any certificate...

Do you have any idea of what is happening ?

Both server's are using PHP of the same version, OpenSSL too ( same
version). the only noticeable difference is :
-The new one is using ZEND performance suite ( licensed )

-New server ( failing) configure command :
Configure Command './configure'
'--with-apxs=/usr/local/apache/bin/apxs' '--with-dbase'
'--with-filepro' '--with-xml' '--enable-ftp' '--with-db'
'--enable-bcmath' '--enable-calendar' '--with-jpeg-dir'
'--with-png-dir' '--with-gd' '--enable-gd-native-ttf'
'--with-freetype-dir' '--with-gettext' '--with-pgsql=/usr'
'--with-mysql=/usr' '--with-zlib-dir' '--enable-trans-sid'
'--with-imap' '--with-kerberos' '--with-imap-ssl' '--with-openssl'
'--enable-sysvsem' '--enable-sysvshm' '--with-curl=/usr/local/lib'

-Old server ( OK) configure commands :
'./configure' '--enable-discard-path'
'--with-config-file-path=/usr/local/lib' '--enable-sigchild'
'--enable-magic-quotes' '--enable-short-tags' '--with-exec-dir=/home/'
'--with-openssl' '--disable-rpath' '--enable-libgcc' '--disable-pic'
'--with-zlib=/' '--enable-bcmath' '--enable-calendar'
'--with-curl=/usr/local' '--with-gdbm=/usr'
'--with-db3=/usr/local/BerkeleyDB.3.3' '--enable-dbase'
'--enable-xslt' '--with-xslt-sablot' '--with-dom' '--with-dom-xslt'
'--with-dom-exslt' '--enable-exif' '--enable-mbstring'
'--enable-mbregex' '--enable-filepro' '--enable-ftp'
'--with-ming=/usr/local' '--with-gd=/usr/local'
'--enable-gd-native-tt' '--with-jpeg-dir=/usr'
'--with-png-dir=/usr/local' '--with-ttf=/usr/local'
'--with-t1lib=/usr' '--with-gettext=/usr' '--with-imap=/usr/local'
'--with-kerberos' '--with-imap-ssl' '--with-mcrypt=/usr/local'
'--with-mhash=/usr/local' '--with-mysql=/usr'
'--with-pdflib=/usr/local' '--with-jpeg-dir=/usr'
'--with-png-dir=/usr/local' '--with-tiff-dir=/usr'
'--with-sablot=/usr/local' '--with-expat-dir=/usr'
'--enable-trans-sid' '--with-regex=system' '--enable-sysvsem'
'--enable-sysvshm' '--enable-wddx' '--with-zziplib=/usr'
'--enable-inline-optimization' '--with-gnu-ld'

Thanks for your help ! It's been 2 days I'm stuck on that thing :( :(

tetedeiench
Jul 17 '05 #1
0 1810

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
1973
by: tshad | last post by:
I am trying to run a test sending mail using CDONTS on my W2K3 machine. It works fine running from my WXP Pro, but I don't recieve the mail if run the W2K3 machine. Both machines have IIS configured essentially the same. ******************************************************************************************
6
1927
by: sirius | last post by:
I have a simple database in ms access, one table with some 10-15 recordets. When creating web page in asp (vbscript) on my local machine, which displays the contents of access database, everything works fine (on local server, dreamweaver, inetpub/ etc etc...). Problem appears when i upload entire site (form my d:\inetpub\wwwroot\site_name) to my web server. Server is based on NT techn., all the html files appear normally, but this page in...
2
1906
by: Richard West | last post by:
I have installed the beta of Dot Net Framework 2.0 on my server, running IIS 5 and Win 2K Server. I have configured my test virutal directory to use ASP.NET version 2.0.40607.0 (under the ASP.NET tab in the directory properties). I am having problems getting this site to work. When I goto this virutal directory I get the following error message: Failed to access IIS metabase.
10
3786
by: Lisa | last post by:
In translating the formula for calculating lottery odds for various conditions into a Visual Basic Program, I have apparently missed something in that I get errors in the part of the calculation where the number of ways of failure (pFal) is calculated Both errors happen in the code section x1 = Draw - MatchesReq x2 = Field - Selections For Counter = 1 To (Draw - MatchesReq - 1) x1 = x1 * (Draw - MatchesReq - Counter)
2
2074
by: d3vkit | last post by:
Okay so I can NOT get my while loop to work. It's the most confusing thing I've ever come across. It was working fine and then suddenly, nothing. No error. The page just dies. I am using PHP5 with mysql. Same problem in Fx 2.0 and IE 7. I have the query sort of spread out across three pages to make it easier for me to generate it; I have a pagination script which checks what is being accessed from the query string (is it the whole blog or an...
10
1688
by: Mike | last post by:
I have code that is doing some updating to a record. Its getting the ID to update from the Grid. I'm passing an INT to my method to update the record. My code is working though I'm still getting an 'input string was not in a correct format.' Code: foreach (GridViewRow row in grid.Rows) { CheckBox chk = (CheckBox)gr.FindControl("checkbox"); if (chk.Checked) {
7
203
by: Cherrish Vaidiyan | last post by:
hello, I am been getting mad with so many doubts and errors.. I have posted some doubts,test cases regarding listener,replication and standby database.But i havent got any response..(I am sorry as some of the queries i have posted twice).Is it that my doubt are funny and simple for u gurus. I am just interested in Oracle on Linux . i request u all to guide me.
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.