Thanks a lot to Robert,Mike and Massimiliano for your help.

I got a some suggestion form Hirsch as  following:

I believe the problem is that the join can take multiple lines (if the cert is over 
multiple lines, and make them into one string), but the C++ code is including the 
newlines. 
I am not familiar with getline, I think fgets includes the newline. 
So my suggestion is check that you are not incorporating newlines in your 
concatenation. 


So I modified my program as:

char result[2000],ch;
int i=0;
CERT=fopen("/usr/local/ssl/certs/cert.result");
printf(Content-Type: application/x-x509-user-cert\n\n");
while( ((ch=getc(CERT))!= EOF) && ((ch=getc(CERT))!= '\n') )
  result[i++] = ch;
fclose(CERT);
printf ("%s",result);

I can only use 
  print "Content-Type: application/x-x509-user-cert\n\n"; 
in perl to have the certificate installed in browser.  

print "Content-Length: $len\n\n"; 
is not necessary.

But I still can not get certificate at browser although it has been signed by CA. 
What's more,
strlen(result) is not equal to i. For example, i is 834 but strlen(result) is 30. I do 
not know the reason.

Can you offer any help? Thanks!

Karl
 



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to