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 Chef encountered an error attempting to create the client “ec2mod
ule” Running handlers: [2016-01-20T11:39:26+00:00] ERROR: Running exception handlers Running handlers complete [2016-01-20T11:39:26+00:00] ERROR: Exception handlers complete Chef Client failed. 0 resources updated in 03 seconds [2016-01-20T11:39:26+00:00] FATAL: Stacktrace dumped to /var/chef
/cache/chef-stacktrace.out [2016-01-20T11:39:26+00:00] FATAL: Please provide the contents of
the stacktrace.out file if you file a bug report [2016-01-20T11:39:26+00:00] ERROR: undefined method `length’ for
nil:NilClass [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
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=* is the required format but it is CN= format.

The host name is missing in CN field.