Re: [PHP-DEV] Soap over SSL and

2009-07-07 Thread Brian A. Seklecki
On Tue, 2009-07-07 at 15:42 +0200, endrazine wrote:
> 
> It is lacking any type of authentication of the payment gateway, which
> is not acceptable.
> 

I agree+++.  

The problem is that PHP SOAP uses an internal "streams" library instead
of libcurl; the former lacks, the later has, client/server PKI support.

If it did use libcurl, dozens of problems over the last few years would
have magically solved themselves (pipe-line'ing, keep-alive, socket
options, PKI, etc.)

Support needs to be added to PHP for this and it's been on the
back-burner for me, but I think it is time to take it to the next level.

This being 2009, and all, perhaps a few organizations can pool resources
and sponsor the needed development.

~BAS

> So in a nutshell, my problem is : can I get acces to the x509
> certificate used by SoapClient ? Is there an api to then verify the
> whole authority certification chain up to the root certificates I may
> decide to trust automagically, or shall I use the openssl api ?




-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Socket Timeout Documentation

2009-07-01 Thread Brian A. Seklecki
All:

Perhaps we should clarify the socket tuneables such as:

  ; Default timeout for socket based streams (seconds)
  default_socket_timeout = 60

These are slightly ambiguous.  e.g., we should clarify connect()
timeouts v.s. "idle" timeouts.  

There are at least a dozen tickets open related to timeout behavior and
a lot of the confusion results of ambiguity in the variable naming
convention and documentation.

 ~BAS




-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-30 Thread Brian A. Seklecki


On Mon, 29 Dec 2008, Ilia Alshanetsky wrote:

Here is a pretty simple patch that will provide the indicated function. If no 
one objects I'll commit it to 5.3/6 branches in the next day or two.


This patch builds cleanly against 5.2.8 in FreeBSD ports!

I'll shoot you an e-mail from my work account (CC:) -- we owe you.

~BASIndex: ext/standard/dns.c
===
RCS file: /repository/php-src/ext/standard/dns.c,v
retrieving revision 1.70.2.7.2.5.2.8
diff -u -p -a -d -r1.70.2.7.2.5.2.8 dns.c
--- ext/standard/dns.c  3 Nov 2008 11:35:11 -   1.70.2.7.2.5.2.8
+++ ext/standard/dns.c  29 Dec 2008 23:28:59 -
@@ -107,6 +107,27 @@
 static char *php_gethostbyaddr(char *ip);
 static char *php_gethostbyname(char *name);
 
+#ifdef HAVE_GETHOSTNAME
+/* {{{ proto string gethostname()
+   Get the host name of the current machine */
+PHP_FUNCTION(gethostname)
+{
+   char buf[4096];
+
+   if (ZEND_NUM_ARGS()) {
+   WRONG_PARAM_COUNT;
+   }
+
+   if (gethostname(buf, sizeof(buf) - 1)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to fetch 
host [%d]: %s", errno, strerror(errno));
+   RETURN_FALSE;
+   }
+
+   RETURN_STRING(buf, 1);
+}
+/* }}} */
+#endif
+
 /* {{{ proto string gethostbyaddr(string ip_address)
Get the Internet host name corresponding to a given IP address */
 PHP_FUNCTION(gethostbyaddr)
@@ -134,6 +155,7 @@ PHP_FUNCTION(gethostbyaddr)
 }
 /* }}} */
 
+
 /* {{{ php_gethostbyaddr */
 static char *php_gethostbyaddr(char *ip)
 {
Index: ext/standard/dns.h
===
RCS file: /repository/php-src/ext/standard/dns.h,v
retrieving revision 1.19.2.1.2.1.2.1
diff -u -p -a -d -r1.19.2.1.2.1.2.1 dns.h
--- ext/standard/dns.h  31 Dec 2007 07:17:14 -  1.19.2.1.2.1.2.1
+++ ext/standard/dns.h  29 Dec 2008 23:28:59 -
@@ -31,6 +31,10 @@ PHP_FUNCTION(gethostbyaddr);
 PHP_FUNCTION(gethostbyname);
 PHP_FUNCTION(gethostbynamel);
 
+#ifdef HAVE_GETHOSTNAME
+PHP_FUNCTION(gethostname);
+#endif
+
 #if HAVE_RES_SEARCH && !(defined(__BEOS__)||defined(PHP_WIN32))
 
 PHP_FUNCTION(dns_check_record);
Index: ext/standard/basic_functions.c
===
RCS file: /repository/php-src/ext/standard/basic_functions.c,v
retrieving revision 1.725.2.31.2.64.2.78
diff -u -p -a -d -r1.725.2.31.2.64.2.78 basic_functions.c
--- ext/standard/basic_functions.c  2 Dec 2008 16:27:14 -   
1.725.2.31.2.64.2.78
+++ ext/standard/basic_functions.c  29 Dec 2008 23:28:59 -
@@ -991,6 +991,11 @@ ZEND_BEGIN_ARG_INFO(arginfo_gethostbynam
ZEND_ARG_INFO(0, hostname)
 ZEND_END_ARG_INFO()
 
+#ifdef HAVE_GETHOSTNAME
+ZEND_BEGIN_ARG_INFO(arginfo_gethostname, 0)
+ZEND_END_ARG_INFO()
+#endif
+
 #if HAVE_RES_SEARCH && !(defined(__BEOS__)||defined(PHP_WIN32) || 
defined(NETWARE))
 ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1)
ZEND_ARG_INFO(0, host)
@@ -2990,6 +2995,10 @@ const zend_function_entry basic_function
PHP_FE(gethostbyname,   
arginfo_gethostbyname)
PHP_FE(gethostbynamel,  
arginfo_gethostbynamel)
 
+#ifdef HAVE_GETHOSTNAME
+   PHP_FE(gethostname, 
arginfo_gethostname)
+#endif
+
 #if HAVE_RES_SEARCH && !(defined(__BEOS__) || defined(PHP_WIN32) || 
defined(NETWARE))
PHP_FE(dns_check_record,
arginfo_dns_check_record)
PHP_FALIAS(checkdnsrr,  dns_check_record,   
arginfo_dns_check_record)
Index: configure.in
===
RCS file: /repository/php-src/configure.in,v
retrieving revision 1.579.2.52.2.77.2.38
diff -u -p -a -d -r1.579.2.52.2.77.2.38 configure.in
--- configure.in12 Dec 2008 23:43:17 -  1.579.2.52.2.77.2.38
+++ configure.in29 Dec 2008 23:29:00 -
@@ -575,6 +575,7 @@ getprotobyname \
 getprotobynumber \
 getservbyname \
 getservbyport \
+gethostname \
 getrusage \
 gettimeofday \
 gmtime_r \





On 29-Dec-08, at 4:45 PM, Daniel Brown wrote:


On Mon, Dec 29, 2008 at 16:26, Brian A. Seklecki
 wrote:


All:

Is anyone interested in adding POSIX 1003.1-2001 gethostname(2)  
support? I'm

interested in sponsoring a small contract development initiative.

I need something more reliable than $_ENV[].   Not all shells export
$HOSTNAME by default.


   Brian,

   As you most likely mean the core engine, Brian, this email is
being forwarded to the Internals maili

Re: [PHP-DEV] My musings on... a Solaris test platform

2007-10-15 Thread Brian A. Seklecki

On Mon, 15 Oct 2007, Rob Thompson wrote:


Hello,

I've been thinking about Solaris support for PHP and some of the
difficulty surrounding reproducing bugs under different Solaris OS
versions, not to mention OS patch versions.


If you cant get traction feeding Sun-specific patches upstream, you should 
you should work with the Pkgsrc people.  Pkgsrc can save Solaris (in that 
Stabbing Westward sense).  See:


http://pkgsrc.habel.name/packages/SunOS-5.9-sparc/lang/

php-5.2.3nb2.tgz2007-Jun-10 11:53:473.2Mapplication/x-tgz
php-5.2.3nb3.tgz2007-Sep-27 16:54:003.2Mapplication/x-tgz

http://www.pkgsrc.org/

They're experts at resolving toolchain and portability problems.  They're 
also not likely to turn down access to hardware for bulk-build machines.


Oh and bug reports wont get closed as "Won't fix" :)

~BAS

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: [PHP] HTTP 1.1 keep-alive support in ext/soap/php_http.c ? (fwd)

2007-08-18 Thread Brian A. Seklecki


Shall I submit a bug/patch to uncomment the HTTP 1.1 support?  Is it still 
broken with proxy servers?


Thanks,

l8*
-lava (Brian A. Seklecki - Pittsburgh, PA, USA)
   http://www.spiritual-machines.org/


-- Forwarded message --
Date: Tue, 14 Aug 2007 19:33:26 -0400 (EDT)
From: Brian A. Seklecki <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [PHP] HTTP 1.1 keep-alive support in ext/soap/php_http.c ? (fwd)


Found it:

http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?annotate=1.109

Lines 892->895 and 903->905 bring the violence.

Rev 1.28 commented it out:

http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.27&r2=1.28


The bugs assocaited with it are:
 http://bugs.php.net/bug.php?id=33164
 http://bugs.php.net/bug.php?id=30329

Please advise on a course of action -- I will open another bug report if 
requested.


http://wiki.apache.org/ws/FrontPage/Axis/AxisCommonsHTTP

Extract from [WWW] RFC 2616 : HTTP/1.1 - Persistent Connection :

"* An HTTP/1.1 server MAY assume that a HTTP/1.1 client intends to maintain a 
persistent connection unless a Connection header including the connection-token 
"close" was sent in the request."


Then presumably, unless the server explicitly closes the connection by 
instructing the client to do so in headers, the client may simply check for the 
presence of "HTTP/1.1" and continue to cane the connection/socket.


Cane one!

~BAS

On Tue, 14 Aug 2007, Brian A. Seklecki wrote:



Re-send to php-general@ since soap@ is a ghost town.

Per the msg below, still trying to figure out why each client call to any 
server results in a new TCP socket being built and closed (BAD!)


I finally got around to:
 print "Request :\n" . $soapClient->__getLastRequestHeaders() . "\n";
 print "Request :\n" . $soapClient->__getLastRequest() . "\n";
 print "Response:\n" . $soapClient->__getLastResponseHeaders() . "\n";
 print "Response:\n" . $soapClient->__getLastResponse() . "\n";

As well as checking tcpdump(8) --- my worst fears are confirmed.

The client headers says:
Connection: Keep-Alive

The server header response says:
Response:
HTTP/1.1 200 OK
Content-Type: application/soap+xml;charset=utf-8
Transfer-Encoding: chunked
Date: Tue, 14 Aug 2007 22:35:07 GMT
Server: Apache-Coyote/1.1

And yet, the PHP client running from the CLI binary executing the same 
function call to the server opens & closes two sockets to accomplish the 
work!


~BAS

-- Forwarded message --
Date: Wed, 8 Aug 2007 11:51:50 -0400 (EDT)
From: Brian A. Seklecki <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [SOAP] HTTP 1.1 keep-alive support in ext/soap/php_http.c ?


All:

Am I correct in reading ext/soap/php_http.c that the SoapClient / SoapServer 
object will not transmit a "Connection: Close" line into the HTTP header 
(either via the Client call itself or by modifying Apache's response?)


E.g., by default PHP SOAP client recycles HTTP connections to the server for 
calls to methods using the same server object / instance?



l8*
-lava (Brian A. Seklecki - Pittsburgh, PA, USA)
   http://www.spiritual-machines.org/

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




l8*
-lava (Brian A. Seklecki - Pittsburgh, PA, USA)
   http://www.spiritual-machines.org/

"Guilty? Yeah. But he knows it. I mean, you're guilty.
You just don't know it. So who's really in jail?"
~Maynard James Keenan

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php