Tuesday, November 4, 2014

sendmail: Authorization failed

sendmail: Authorization failed (535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 wr9sm385093wjb.42 - gsmtp)

sendmail: Authorization failed (534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 dw9sm955443wib.0 - gsmtp)

If were trying to send email from your host using SSMTP and your gmail account and you got this error, don't pannic it's easy to resolve...

Go to https://www.google.com/settings/security/lesssecureapps and enable "Less secure apps" mode.

Friday, May 16, 2014

3074455752:error:27069065:OCSP routines:OCSP_basic_verify:certificate verify error:ocsp_vfy.c:125:Verify error:self signed certificate
If you are dealing with OCSP server you will get this error if you don't specify the path of CA certificate file in your query, so just add the -CA param followed by the relative/absolute path as follow

openssl ocsp -CA <PUT CA CERT PATH HERE> ...

Wednesday, April 30, 2014

ldap_bind(): Unable to bind to server: Protocol error
You have to specify the protocol version prior before making a call to ldap_bind(), when the server is expecting LDAP protocol version 3. else you will receive the above error

In order to avoid this, make this call:

<?php
ldap_set_option($ldapConnResult, LDAP_OPT_PROTOCOL_VERSION, 3);
?>

Where $ldapConnResult  is the result returned by ldap_connect() function.

Call to undefined function ldap_connect()

Call to undefined function ldap_connect()
Just go to php.ini file and un-comment php_ldap extension line

Thursday, April 24, 2014

PEM routines:PEM_read_bio:no start line

PEM routines:PEM_read_bio:no start line
 I got this error when I tried to convert a private key to PKCS12 format using openssl_pkcs12_export() function under PHP, after 48 hours of trying many solutions I finally found the wright one, it's soo simple just change the format of the private key (PEM encoded) from

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,25E7BB5EB27D828C

<--- Private key here ----->
-----END RSA PRIVATE KEY-----

to

-----BEGIN RSA PRIVATE KEY-----
<--- Private key here ----->
-----END RSA PRIVATE KEY-----
 
That's all !

I reported this error to PHP and it's published on function manual http://www.php.net/manual/en/function.openssl-pkcs12-export.php#114908

Wednesday, April 23, 2014

error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt error:0906A065:PEM routines:PEM_do_header:bad decrypt
I got this error while working with OpenSSL library  on PHP, this happen when you try to export the private key of a certificate using bad passphrase, just make sure taht you are using the wright one.

Thursday, March 13, 2014

Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0
  The web server can't load an external php file, to patch it, go to php.ini file, find allow_url_include=off  and set it to on, restart all apache services and it's done !

Note: it's insecure to allow external files to be included in your web page (see why) so use it on your own risk.

Monday, March 10, 2014

RSA operation error
5747:error:0406D06E:rsa routines:RSA_padding_add_PKCS1_type_2:data too large for key size:rsa_pk1.c:151:
Basically RSA is not aimed to encrypt large data file, so you will get this error when you try to encrypt a file such as length(file) > length(RSA key).
I suggest to calculate first hash version of the file using MD5 or SHA-1 then encrypt it using the key.

Note: in real cryptographic system, RSA public/private key are only used to exchange symmetric key.

Friday, March 7, 2014

How to Fix: Ubanble to establish VPN

it was strange for me at first time to get this error , first thing that I did in order to solve it is to check that the VPN server is reachable using Ping command and the firewall is configured to let VPN access ... I found everything working well, so after deep searching I found that Internet Connection Sharing  (ICS) service is the responsible of that, I turned  it off and the VPN tunnel is re-established. 

NB: is not recommended to turn off ICS service permanently 

Tuesday, March 4, 2014

You probably face this error while using OpenSSL
WARNING  can't open config file
Unable to load config info from
That's mean, openssl can't find configuration file - generally known us openssl.cnf - so you have to set the envirement variable OPENSSL_CONF to the configuration file path, for example:

#export OPENSSL_CONF=/etc/ssl/openssl.cnf

That's all folks !

Monday, March 3, 2014

If you get the following error while issuing a digital certificate using OpenSSL library under PHP
error:0D11A086:asn1 encoding routines:ASN1_mbstring_copy:string too short
you probably set an empty string in Distinguished Name (dn) arrayit you want to let it empty just give it " " (space) value.

Saturday, March 1, 2014

I faced the first time this error when I set-up a Domain Controller on Ubuntu using SAMBA 4 and I tried to join this domain using my Windows 7 machine.
Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012 or Windows 8 require some registry changes while dealing with Samba server, to solve this problem just copy and past the following lines in a text editor like Notepad (or bloc note) and save it under .reg extension.
 
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters]
"DomainCompatibilityMode"=dword:00000001
"DNSNameResolutionRequired"=dword:00000000

execute .reg file as administrator, reboot and it's done !

Friday, February 28, 2014

This warning  occurred while restarting Apache server and two or more virtuelHost (VH) are listening on the same port, to avoid it just change listening port of  VH in http.conf file, here is an example
<VirtualHost *:8080>

NB: If you are setting ServerName for each VH you may not face this Warning.
This how to fix
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
In order  to solve this problem You need set the ServerName in httpd.conf file, for example in my case I used "ubuntu" as a server name
  • first goto httpd.conf
#vim /etc/apache2/httpd.conf/
  •  set ServerName attribute to ubuntu
ServerName ubuntu
  • Restart apache2
#service apche2 restart

That's All!

Wednesday, February 26, 2014



Usually Networks crafters are front of this kind of errors; there are two reasons behind this error.
1-        Operating system can't recognize the plugged device due to miss of driver (I will not discuss this problem here…)
2-       Network card is correctly recognized but can't get IP address.
first thing to do in order to solve this problem is to make sure that the network card correctly  plugged and recognized on the system using  lspci or lsub command depending of the type of NC (Network Card), in my case I'm using an usb Wi-Fi adapter.


 So the network card is known for the system, else it's a type 1 problem …
Secondly we have to find which alias is used to identify the adapter, the simple way is to iterate possible combination (if you have a simpler manner to find the match alias please share it with us)


Wlan1 is my Wifi usb adapter alias ... we have then to edit /etc/network/interfaces as bellow

Restart network service and it's resolved!
NB: In your case Wlan1 may be eth0, eth1 ..etc.

Tuesday, February 25, 2014

This error is frequently appeared when we try to sign a certificate using openssl, the procedure to resolve this error is:

Create the index.txt file.
# touch /etc/pki/CA/index.txt

Create a serial file to label the CA and all subsequent certificates.
# echo '1000' > /etc/pki/CA/serial

NB: You have to do this just the first time you set-up the SSL certificate.

Monday, February 24, 2014

It's common to get this error while using vsftp (very secure FTP) and trying to connect to ftp server through a client, the reason behind is that ftp daemon can not read/find chroot_list,  to resolve this problem just create the specified file using the following command:

#touch /etc/vsftpd/chroot_list

if doesn't work for you just give me a hint