Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004224TestLinkContribution Maintained BY USERpublic2011-02-06 15:332012-09-06 18:24
Reporterswkide 
Assigned Tofman 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.9 (Prague) 
Fixed in Version1.9.4 (2012 Q3 - bug fixing) 
Summary0004224: Testlink TRAC Integration IXR_Client does not support https connections
DescriptionTestlink TRAC Integration IXR_Client does not support https connections
Steps To Reproducetry to use https URL as BUG_TRACK_DB_HOST
like:

define('BUG_TRACK_DB_HOST', 'https://src.authbox.de/' [^]);

in trac.cfg.php
TagsNo tags attached.
Database (MySQL,Postgres,etc)don't know
Browser
PHP Version
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Filesdiff file icon class-IXR.php.diff [^] (9,927 bytes) 2011-02-06 17:32 [Show Content]
zip file icon TL-BTS-https-auth-0.2.zip [^] (17,340 bytes) 2011-02-16 22:58
zip file icon multiple trac and https.zip [^] (4,304 bytes) 2012-08-23 11:17

- Relationships

-  Notes
(0013525)
fman (administrator)
2011-02-06 16:18

1. provide database type
2. provide detailed steps to reproduce and error messages
(0013527)
swkide (reporter)
2011-02-06 16:39

1. Sorry was not clear to me which database ...
Testlink Database Type is MySQL

PHP Version is 5.3.2
OS: Ubuntu 10.04 LTS
TestLink 1.9 (Prague)
Trac: 0.11.7


2. Steps:
use https URL as BUG_TRACK_DB_HOST
like:
define('BUG_TRACK_DB_HOST', 'https://src.authbox.de/' [^] [^]);
in trac.cfg.php

In Testlink on a failed test use the bugtracker icon.

In the new windows insert an existing Bug ID like '2'

Result: Bug ID does not exist on BTS!

I tracked it down until I reached:
third_party/xml-rpc/class-IXR.php
in Class IXR_Client, starting on line 457
there ist a default port of 80 for xmlrpc requests.
changing the port, as I tried is not enought, because the class doesn't switch
to https requests.
Then I was out, because I cannot patch that into ...

3. I cannot edit my reported issues - is that correct, or did I simply don't find the button?

Yours,

Stephan
(0013528)
fman (administrator)
2011-02-06 17:31
edited on: 2011-02-06 17:32

Found similar report with patch on:
http://core.trac.wordpress.org/ticket/16402 [^]

would you mind to try this solution and give us feedback ( I've no means to test TRAC integration).

I've uploaded file found on wordpress site.
If all is ok we will patch TestLink

(0013529)
swkide (reporter)
2011-02-06 17:33

I found that also, only the versions of class-IXR.php seem to differ - I will dig al little deeper into that next week.

Sure I will test it and report feedback.
(0013601)
swkide (reporter)
2011-02-13 10:57

Hello again,

I roughly understand, what they are doing in the WP solution. They wrote a wrapper class around IXR_Client and do not use fsockopen any more but some WP http classes.

So I have to implement an https fsockopen. Found a way to do this already, but in which file do I implement the wrapper class.

Any suggestions?
(0013602)
fman (administrator)
2011-02-13 15:33

are you sure the diff I've uploaded can not help without a wrapper ?
(0013603)
swkide (reporter)
2011-02-13 17:53

quite sure - perhars wrapper is the wrong term.
They use this:

class WP_HTTP_IXR_Client extends IXR_Client {

something like subclassing - so they do not edit the third party code.
(0013604)
fman (administrator)
2011-02-13 18:38

development of incutio seems frozen => do not care about changing it's code and have a version for TL . please follow this direction
(0013605)
swkide (reporter)
2011-02-14 00:37

here comes the first patch - but needs more testing!

---8<---
Index: class-IXR.php
===================================================================
--- class-IXR.php (revision 51)
+++ class-IXR.php (revision 52)
@@ -12,6 +12,10 @@
    Made available under the BSD License: http://www.opensource.org/licenses/bsd-license.php [^]
 */
 
+/*
+ Added https support for IXR_Client, 14rd Feb 2011 swkide(at)authbox(dot)de
+*/
+
 class IXR_Value {
     var $data;
     var $type;
@@ -460,8 +464,11 @@
     var $path;
     var $useragent;
     var $response;
+ var $ssl = false;
+ var $fsock_server = '';
     var $message = false;
     var $debug = false;
+ //var $debug = true;
     var $timeout;
     // Storage place for an error message
     var $error = false;
@@ -469,8 +476,13 @@
         if (!$path) {
             // Assume we have been given a URL instead
             $bits = parse_url($server);
+ $this->scheme = $bits['scheme'];
+ if (trim($this->scheme) == 'https') {
+ $port = 443;
+ $this->ssl = true;
+ }
             $this->server = $bits['host'];
- $this->port = isset($bits['port']) ? $bits['port'] : 80;
+ $this->port = isset($bits['port']) ? $bits['port'] : $port;
             $this->path = isset($bits['path']) ? $bits['path'] : '/';
             // Make absolutely sure we have a path
             if (!$this->path) {
@@ -483,6 +495,11 @@
         }
         $this->useragent = 'Incutio XML-RPC';
         $this->timeout = $timeout;
+ if ($this->ssl) {
+ $this->fsock_server = "ssl://".$this->server; [^]
+ } else {
+ $this->fsock_server = $this->server;
+ }
     }
     function query() {
         $args = func_get_args();
@@ -502,11 +519,14 @@
             echo '
'.htmlspecialchars($request)."\n
\n\n";
         }
         if ($this->timeout) {
- $fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout);
+ $fp = @fsockopen($this->fsock_server, $this->port, $errno, $errstr, $this->timeout);
         } else {
- $fp = @fsockopen($this->server, $this->port, $errno, $errstr);
+ $fp = @fsockopen($this->fsock_server, $this->port, $errno, $errstr);
         }
         if (!$fp) {
+ if ($this->debug) {
+ echo "$errstr ($errno)
\n";
+ }
             $this->error = new IXR_Error(-32300, "transport error - could not open socket: $errno $errstr");
             return false;
         }
@@ -516,6 +536,7 @@
         $gettingHeaders = true;
         while (!feof($fp)) {
             $line = fgets($fp, 4096);
+ //print 'line :'.$line.":
";
             if (!$gotFirstLine) {
                 // Check line for '200'
                 if (strstr($line, '200') === false) {



--->8---

Cheers!
(0013628)
swkide (reporter)
2011-02-15 20:19

I found out, that the file class-IXR.php has "dos" linefeeds- so the patch does not succed. I have made a new one with authorisation (user/pass) to trac also. Shall I change the patch or will the file format of class-IXR.php will be changed?
(0013642)
fman (administrator)
2011-02-16 17:55

Please do not attach patch, but full code commented.
We are not going to change format of class-IXR.php
(0013645)
swkide (reporter)
2011-02-16 23:00

Uploaded Zip file with all files.

Added https and basic auth to class.IXR.php and

Removed credentials from enterBugURL and showBugURL in int_trac.php, because IE does not allow usage of user and pass in URLs by default.
(0013715)
fman (administrator)
2011-02-21 19:45

@swkide
OK we will review your code and try to add to stable release
(0013716)
swkide (reporter)
2011-02-21 20:01

Ok fine!
I would like to know, if my code is ok for you, when you reviewed it.
(0017156)
fman (administrator)
2012-08-23 11:00
edited on: 2012-08-23 11:01

More info
http://devzone.zend.com/97/xml_rpc-client/ [^]

http://stackoverflow.com/questions/2446405/http-authentication-with-phps-zend-xml-rpc-client [^]

(0017157)
RvdP2012 (reporter)
2012-08-23 11:20

Added a changed version for int_trac.php and trac.cfg.php which allows both http and https clients to be used. In addition, it allows you to use different trac-servers and accounts for different testlink projects.

Tested and running for about one month now without noticable problems.
(0017158)
fman (administrator)
2012-08-23 13:01

https://twitter.com/TLOpenSource/status/238622162313940992 [^]

- Issue History
Date Modified Username Field Change
2011-02-06 15:33 swkide New Issue
2011-02-06 16:18 fman Note Added: 0013525
2011-02-06 16:39 swkide Note Added: 0013527
2011-02-06 17:31 fman Note Added: 0013528
2011-02-06 17:32 fman File Added: class-IXR.php.diff
2011-02-06 17:32 fman Note Edited: 0013528 View Revisions
2011-02-06 17:32 fman Assigned To => fman
2011-02-06 17:32 fman Status new => assigned
2011-02-06 17:33 swkide Note Added: 0013529
2011-02-13 10:57 swkide Note Added: 0013601
2011-02-13 15:33 fman Note Added: 0013602
2011-02-13 17:53 swkide Note Added: 0013603
2011-02-13 18:38 fman Note Added: 0013604
2011-02-14 00:37 swkide Note Added: 0013605
2011-02-15 20:19 swkide Note Added: 0013628
2011-02-16 17:55 fman Note Added: 0013642
2011-02-16 22:58 swkide File Added: TL-BTS-https-auth-0.2.zip
2011-02-16 23:00 swkide Note Added: 0013645
2011-02-21 19:45 fman Note Added: 0013715
2011-02-21 20:01 swkide Note Added: 0013716
2012-08-23 11:00 fman Note Added: 0017156
2012-08-23 11:01 fman Note Edited: 0017156 View Revisions
2012-08-23 11:17 RvdP2012 File Added: multiple trac and https.zip
2012-08-23 11:20 RvdP2012 Note Added: 0017157
2012-08-23 13:01 fman Note Added: 0017158
2012-08-23 13:04 fman Task Workflow Status => TBD
2012-08-23 13:04 fman Category Integration with Other Systems => Contribution Maintained BY USER
2012-09-06 18:24 fman Task Workflow Status TBD => READY FOR TESTING
2012-09-06 18:24 fman Status assigned => closed
2012-09-06 18:24 fman Resolution open => fixed
2012-09-06 18:24 fman Fixed in Version => 1.9.4 (2012 Q3 - bug fixing)



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker