473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

XML over HTTPS

I am having trouble sending XML data over HTTPS.

Clients connect to server using SSL_XXX system calls
and server is running apache.

This is my whole script.

#!/usr/bin/perl -w

print "Content-Type: text/xml\n\n";
print "asdf\n\n";

When clients tries to read the content they dont see anything beyond
"content-type: text/xml".

Appreciate your help on this.

Thanks.

Jul 20 '05 #1
6 3425
chitu (cp******@gmail.com) wrote:
: I am having trouble sending XML data over HTTPS.

: Clients connect to server using SSL_XXX system calls
: and server is running apache.

: This is my whole script.

: #!/usr/bin/perl -w

: print "Content-Type: text/xml\n\n";
: print "asdf\n\n";

That data isn't xml, maybe that's the problem.

: When clients tries to read the content they dont see anything beyond
: "content-type: text/xml".

What do you mean? A person would not normally see the content-type:
header. Do you mean that some program you're running doesn't receive any
data after that header?

--

This space not for rent.
Jul 20 '05 #2

Malcolm Dew-Jones wrote:
chitu (cp******@gmail.com) wrote:
: I am having trouble sending XML data over HTTPS.

: Clients connect to server using SSL_XXX system calls
: and server is running apache.

: This is my whole script.

: #!/usr/bin/perl -w

: print "Content-Type: text/xml\n\n";
: print "asdf\n\n";

That data isn't xml, maybe that's the problem.
I was trying to keep things simple.
The actual script is

#!/usr/bin/perl -w
print "Content-type: text/xml\n\n";
print <<"EOF";
<?xml version="1.0" encoding="ISO-8859-1"?>
<Response Type="Transaction">
<ErrNo>10</ErrNo>
</Response>
EOF

In my client program after I read the content using SSL_read (xml
parsing will
be done down the line) I print the content and I dont see anything
beyond
"Content-type: text/xml".
Basically I dont see anything after the \n\n.If I remove them I get 404
Error.

: When clients tries to read the content they dont see anything beyond : "content-type: text/xml".

What do you mean? A person would not normally see the content-type: header. Do you mean that some program you're running doesn't receive any data after that header?

--

This space not for rent.


Jul 20 '05 #3
chitu (cp******@gmail.com) wrote:

: Malcolm Dew-Jones wrote:
: > chitu (cp******@gmail.com) wrote:
: > : I am having trouble sending XML data over HTTPS.
: >
: > : Clients connect to server using SSL_XXX system calls
: > : and server is running apache.
: >
: > : This is my whole script.
: >
: > : #!/usr/bin/perl -w
: >
: > : print "Content-Type: text/xml\n\n";
: > : print "asdf\n\n";
: >
: > That data isn't xml, maybe that's the problem.

: I was trying to keep things simple.
: The actual script is

: #!/usr/bin/perl -w
: print "Content-type: text/xml\n\n";
: print <<"EOF";
: <?xml version="1.0" encoding="ISO-8859-1"?>
: <Response Type="Transaction">
: <ErrNo>10</ErrNo>
: </Response>
: EOF

: In my client program after I read the content using SSL_read (xml
: parsing will
: be done down the line) I print the content and I dont see anything
: beyond
: "Content-type: text/xml".
: Basically I dont see anything after the \n\n.If I remove them I get 404
: Error.

Each line break is supposed to be the two character sequence "\r\n" (i.e.
Carriage-return Line-feed, normally "\r\n" will do that in perl, though on
some hardware you might need something else).

Perhaps that makes a difference.

(and the end of header would be written "\r\n\r\n").

--

This space not for rent.
Jul 20 '05 #4
On Wed, 11 May 2005, Malcolm Dew-Jones wrote:
Each line break is supposed to be the two character sequence "\r\n" (i.e.
Carriage-return Line-feed, normally "\r\n" will do that in perl,
What \r and \n represent in Perl is patform-dependent. If you mean
precisely carriage return and linefeed, then you better code what you
mean, i.e \012 and \015.

There's a Perl FAQ about this issue.
though on some hardware you might need something else).
If you do it right then that problem disappears. (Well, there's also
the problem of EBCDIC-based platforms...)
Perhaps that makes a difference.


That depends on whether the script is constructing a CGI response, or
an HTTP response.

CGI responses are governed by the CGI specification (now an
informational RFC) and addressed by Perlfaq9. They accept the
platform's own newline representation (it's the server's job to
construct a protocol-conforming HTTP response based on them).

HTTP responses are governed by RFC2616 and do indeed call for CRLF
as the newline representation, irrespective of platform.

Ref: http://perlpod.com/5.9.1/pod/perlfaq9.html
"What is the correct form of response from a CGI script?"

(I have to declare an interest, but that was written after an
intensive peer review ;-)

all the best
Jul 20 '05 #5
In article <11**********************@g43g2000cwa.googlegroups .com>,
chitu <cp******@gmail.com> wrote:

[...]

% I was trying to keep things simple.
% The actual script is
%
% #!/usr/bin/perl -w
% print "Content-type: text/xml\n\n";
% print <<"EOF";
% <?xml version="1.0" encoding="ISO-8859-1"?>
% <Response Type="Transaction">
% <ErrNo>10</ErrNo>
% </Response>
% EOF
%
% In my client program after I read the content using SSL_read (xml
% parsing will
% be done down the line) I print the content and I dont see anything
% beyond
% "Content-type: text/xml".

Did you try calling SSL_read again? Perhaps it's not getting everything
the first time.
--

Patrick TJ McPhee
North York Canada
pt**@interlog.com
Jul 20 '05 #6
chitu wrote:
: I am having trouble sending XML data over HTTPS.

: Clients connect to server using SSL_XXX system calls
: and server is running apache.
The actual script is

#!/usr/bin/perl -w
print "Content-type: text/xml\n\n";
print <<"EOF";
<?xml version="1.0" encoding="ISO-8859-1"?>
<Response Type="Transaction">
<ErrNo>10</ErrNo>
</Response>
EOF

In my client program after I read the content using SSL_read (xml
parsing will be done down the line) I print the content and I dont see anything
beyond "Content-type: text/xml". Basically I dont see anything after the \n\n.
What happens when you point a web browser at the URL?
What happens when you point wget at the URL?
wget -S -O - https://localhost/cgi-bin/yourscript.pl
If I remove them I get 404 Error.


Your script is then no longer emitting valid HTTP headers, so Apache
will report an error (should be a 500 not a 404).

Have you tried writing a simple server using SOAP::Lite? You could then
protoype the client using Perl SOAP::Lite (or at least use a perl client
to verify correct server operation).
Jul 20 '05 #7

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

Similar topics

8
by: NotGiven | last post by:
I need to verify if the page that led the user to this page used http or httpS. for example, if the use cam to my page from: httpS://www.dm.com/sample/foo.php I want to know as opposed to...
0
by: kiran | last post by:
Hi, I hosted a PHP project on my web server(IIS) and I am accessing the ip addres through my office public address like this: (example) https://61.95.204.43:8887/phptest/test.php ...
2
by: Craig Keightley | last post by:
i have the following script on my checkout page to check if https is set in the address bar: if ($_SERVER != "on") { $url = $_SERVER; $query = $_SERVER; $path = $_SERVER; header("Location:...
16
by: Paul Sweeney | last post by:
Does anyone know of a working (python) https proxy which allows viewing of unencrypted data being sent from my browser to an https site? I've worked my way through most on the list at...
12
by: Grunff | last post by:
I'm experiencing an interesting problem with carrying a php session over from http to https. Much googling later, I'm still stuck. The application is an online shop, where some user data is...
14
by: Peter Chant | last post by:
I'm currently authenticating a site I have built using basic http authentication built into apache. This has zero overhead on php which is a bonus but it seems to not quite work how I'd like. ...
4
by: Jason P | last post by:
Basically we have a web method with a dynamic URL. The client is developed in C++ and I've been using the webReference.SetUrl( "http://test.example.com..." ) method successfully with various web...
14
by: david | last post by:
I have developed web forms including login by using ASP.NET via HTTP. Now I want to secure the connection from client to the server via HTTPS. How can I configure the server or something else to...
2
by: scott mcfadden | last post by:
Using VS 2003, I can not add a web reference to our production server's ..asmx URL using HTTPS. I will put in a URL like: https://mycompany.com/myapp/myservice.asmx VStudio will display the...
0
by: NoaGross | last post by:
Hi, I'm relly new in java and I have a problem. I'm using java applet. When using http all ok, but when trying to use https i get: Java Plug-in 1.5.0_10 Using JRE version 1.5.0_10 Java...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.