openssl

Why am i getting "error:1409F07F:SSL routines:SSL3_WRITE_PENDING: bad write retry" error while attempting an SSL_write?

See answer below ...

How can I do an SSL connection with PHP

Hi, I need to develop a PHP class to communicate with Apple servers in order to do Push notification (APNS). I have the certificate (.pem) and I tried to follow various tutorials found on Internet but I'm still getting error trying to connect to ssl://gateway.sandbox.push.apple.com:2195 with stream socket : $apnsHost = 'gateway.sandbox...

how to find the end of soap message recieved from server over ssl connection in c++

i am reading soap message from server over ssl connection using SSL_read(m_pssl,f_data,f_datalen) but it reading 265 bytes first. then i again called SSL_read() and it reads rest of message + starting of message. Can anyone tell me how to find the end of message over server over ssl connection? ...

Create x509 certificate with openssl/makecert tool

I'm creating a x509 certificate using makecert with the following parameters: makecert -r -pe -n "CN=Client" -ss MyApp I want to use this certificate to encrypt and decrypt data with RSA algoritm. I look to generated certificate in windows certificate store and everything seems ok (It has a private key, public key is a RSA key...

Does the openssl command line do key strengthening?

If I run the openssl command line in hmac mode (as below), is the key used for the hmac used directly or is it hashed before using it as the key? echo "foo" | openssl dgst -sha256 -binary -hmac "test" | openssl base64 Similarly, when encrypting a file with openssl (as below)is the pass phrase hashed with the salt? (If so how is it don...

openssl api verify the public key matches private key

How do I write an openssl server that on a single port has two different active RSA private keys? The openssl documentation seems to implies there can only be one rsa private key active at time with in a context. So I was thinking I have two active context, but what is the code to handle figuring out which connection matches which contex...

Extend Emacs to edit encrypted text files

I am trying to add special handling to emacs to handle Triple-DES encrypted files (any file with extension .des3 is assumed to be a valid encrypted text file). My approach is to append to format-alist, like so: (setq format-alist (cons (list 'des3 "Triple-DES encrypted files" ".*\.des3" "show" "" t nil) fo...

How do I install the OpenSSL C++ library on Ubuntu?

I'm trying to build some code on Ubuntu 10.04 LTS that uses OpenSSL 1.0.0. When I run make, it invokes g++ with the "-lssl" option. The source includes: #include <openssl/bio.h> #include <openssl/buffer.h> #include <openssl/des.h> #include <openssl/evp.h> #include <openssl/pem.h> #include <openssl/rsa.h> I ran: $ sudo apt-get insta...

OpenSSL.NET can't export private key with null Cipher

I've recently discovered OpenSSL.NET and it's a pretty sweet little wrapper. I'm trying to execute the following code: public static void DoSomething(byte[] buf) { OpenSSL.Core.BIO input = new OpenSSL.Core.BIO(buf); OpenSSL.X509.X509Certificate b = OpenSSL.X509.X509Certificate.FromPKCS12(input, "passphrase"); ...

What does OpenSSL's EVP mean?

What does OpenSSL's EVP mean? I know it is a higher level crypto interface library in OpenSSL, but what do the letters E-V-P stand for? Thanks, Chenz ...

undefined BIO_new_socket function in OpenSSL library

Hi, I get the following problem with some openssl (yeah, I know it's poorly documented, but I wish to use it any way) code in a project of mine (written in c, on osx and tested in ubuntu): Undefined symbols: "_BIO_new_socket", referenced from: _main in ccG3cvyw.o ld: symbol(s) not found collect2: ld returned 1 exit statu...

libssh2 channel SSL BIO usage

Hi, I'm writing a small ftp project for my own amusement which is suppose to be able to do 4 things: connect directly to a ftp connect directly to a ftp with SSL (wrapper) connect through ssh tunnel to a ftp connect through ssh tunnel to a ftp with SSL. I'm writing my program in plain C (unix, not that it matters in this case) using...

OpenSSL question

I'm looking to create an application in Django which will allow for each client to point their domain to my server. At this point, I would want their domain to be accessed via https protocol and have a valid SSL connection. With OpenSSL, more specifically M2Crypto, can I do this right out the gate? Or, do I still need to purchase an SSL ...

Late response on ssl from server

i am using open gl ssl library. i have created soap packet and send that to server successfully.but response is comming after almost 5 minutes.Server is working fine. what would be the problem and how to speed up response. ...

SHA256 key generator in iphone

Hi friends, I want to generate a key using SHA256 with N number of iterations. They input should be my "password" + "random number" I have seen the Crypto sample provided by apple but it seems it doesn't provide my requirement(or might be possible I didnt get it properly). I have gone through below link as well but is doesnt have met...

Convert .PEM certificate to .PFX Programatically using OpenSSL

I've got a .PEM file that I want to convert to a PKCS12 file (PFX) and I know I can easily accomplish this using the following openssl command: Create a PKCS#12 file: openssl pkcs12 -export -in file.pem -out file.p12 -name "My Certificate" Which is great, but I'd like to do this programmatically using openssl calls. Unfortunately...

SSL_connect/read from "empty" BIO.

Hi, I have a problem making the link between the underlying socket (in this case, a (lib)ssh2 tunnel channel) and the BIO in order to make a handshake. The reason for all the trouble is: the server I wish to handshake with is not an SSL encrypted server initially, and has to be told to turn on SSL before SSL_connect()'ing/handshaking. ...

p7 is NULL with d2i_PKCS7_bio(in,NULL)

Hello, I have PKCS7 signed image in DER format, Verifing with d2i_PKCS7_bio API is always success for first time, but each next failed(returns p7 as NULL). What might be wrong in following code? BIO *in=NULL; PKCS7 *p7=NULL; in=BIO_new(BIO_s_file()); BIO_read_filename(in, fileSigned); if (in == NULL) { BIO_printf(bio_err,"loa...

PHP openssl equivalents for Perl ?

What would be a equivalent example in perl of the bellow code to create a Self-signed certificate ? All i have available is Crypt::OpenSSL::RSA (if there is another module let me know so i can verify it is available or possible to install as i am not the admin/owner and cannot do it myself due to rights issue) which i havent found on th...

Store X.509 certificate in a c-string and load it into SSL_CTX object?

Hi experts, I'm pretty new to openssl. So far I've gone through tutorials offered by IBM and HP and got some practices about how to use openssl APIs. My project is about using a USB security memory token loaded with a digitial certificate to verify the identity of a client via an ActiveX control on the client's browser. Now the proble...