Question: I just want to know can we use this in CodeIgniter..

```
$this->form_validation->set_rules('marriage_id', 'Marriage ID','required|is_unique[marriage.marriage_id]|matches[person.marriage_id]');

```

`marriage` is my table name and `marriage_id` is a field in that table.

`Person` is another table and it also have `marriage_id` `field.From` above controller code, I'm inserting data into `marriage` table and i want to know that can I check, it matches with the `marriage_id` in person table or not.

Answer: 
Turning off host name verification would make your connection vulnerable to MITM attacks. This isn't the right way to fix this.

The problem you have comes from the fact you're using an IP address, and not a host name. Java follows RFC 2818 strictly on this point (unlike some browsers):

> 
> In some cases, the URI is specified as an IP address rather than a hostname. In this case, the iPAddress subjectAltName must be present in the certificate and must exactly match the IP in the URI.
> 
> 
> 

When you generate your certificate, make sure you put the IP address in the Subject Alternative Name (of type IP address), as described [here](https://stackoverflow.com/a/8444863/372643).
Alternatively, use host names instead (although it's still recommended to put the name in the SAN anyway).
The whole SSL certification for webs is based on hostnames. You cannot simply turn off the "host name verification" because it is part of standard. 

To overcame this problem you need to call host by its name specified in issued certificate. If you have central DNS server it is best to configure host names there. If not you can use hosts files on boxes that need to communicate.

* On Windows it will be in: Drive:\Windows\System32\drivers\etc\hosts
* On Linux it is in /etc/hosts

Add following line:
`15.191.34.56 hostName.with.cert.issued`

In your code call server by its name, also you need to make sure JBoss is listening on this name.