Launch and bootstrap aws instance on azure hosted chef server

Encountered this error while launching instance in AWS using knife ec2 plugin

Instance : Ubuntu 14.04
Server: Hosted chef server in Azure marketplace on Ubuntu 14.04

.ap-southeast-1.compute.amazonaws.com Chef encountered an error attempting to create the client “ec2mod
ule”
.ap-southeast-1.compute.amazonaws.com Running handlers:
.ap-southeast-1.compute.amazonaws.com [2016-01-20T11:39:26+00:00] ERROR: Running exception handlers
.ap-southeast-1.compute.amazonaws.com Running handlers complete
.ap-southeast-1.compute.amazonaws.com [2016-01-20T11:39:26+00:00] ERROR: Exception handlers complete
.ap-southeast-1.compute.amazonaws.com Chef Client failed. 0 resources updated in 03 seconds
.ap-southeast-1.compute.amazonaws.com [2016-01-20T11:39:26+00:00] FATAL: Stacktrace dumped to /var/chef
/cache/chef-stacktrace.out
.ap-southeast-1.compute.amazonaws.com [2016-01-20T11:39:26+00:00] FATAL: Please provide the contents of
the stacktrace.out file if you file a bug report
.ap-southeast-1.compute.amazonaws.com [2016-01-20T11:39:26+00:00] ERROR: undefined method `length’ for
nil:NilClass
.ap-southeast-1.compute.amazonaws.com [2016-01-20T11:39:26+00:00] FATAL: Chef::Exceptions::ChildConverg
eError: Chef run process exited unsuccessfully (exit code 1)

Did you look at the stacktrace that log tells you to look at for errors? It
could be loads of different things, so more information is needed.

I am pretty new to chef and I did not understand what this error is, so I do not have an idea what kind of information is to be furnished.

Well somewhere in the code the ‘length’ method is trying to be called
against an object that doesn’t exist. This might be a bug in the code or it
might be a problem with your recipe code, but there’s not enough
information in what you posted to know any more.

Run the command that generated this error again and post the contents of
this file into the thread, you might get more luck
/var/chef/cache/chef-stacktrace.out
If the file is huge you might want to delete it, run the command again and
then post the contents so you’re only getting errors related to one run.

For now I am able to Bootstrap by using --nodessl-verify-mode none in the command but the issue is the ssl certificates downloaded from hosted chef on azure does not have my complete DNS in “CN” due to which ssl certificates are not getting verified.

CN=*.cloudapp.net is the required format but it is CN= .cloudapp.net format.

The host name is missing in CN field.