As per the current behaviour, even if the the cert file provided to rbvmomi consists of multiple SSL certificates, only one of them is placed in the cert store.
replacing add_cert with add_file results in all the certificates in the file being placed in the cert store, thus correcting the behaviour.
Also, removed an un-necessary if condition-
if @opts[:insecure]
As per the current behaviour, even if the the cert file provided to rbvmomi consists of multiple SSL certificates, only one of them is placed in the cert store. replacing add_cert with add_file results in all the certificates in the file being placed in the cert store, thus correcting the behaviour.
Also, removed an un-necessary if condition- if @opts[:insecure]