anchor.diff:  	{_, true = SelfSigned} ->
   	    do_certificate_chain(CertDbHandle, CertsDbRef, Chain, ignore, ignore, SelfSigned, ListDb);
   	{{error, issuer_not_found}, SelfSigned} ->
  -	    case find_issuer(OtpCert, BinCert, CertDbHandle, CertsDbRef, ListDb) of
  +	    case find_issuer(Cert, CertDbHandle, CertsDbRef, ListDb) of
   		{ok, {SerialNr, Issuer}} ->
   		    do_certificate_chain(CertDbHandle, CertsDbRef, Chain,
   					 SerialNr, Issuer, SelfSigned, ListDb);
  
positive.code: 				      subjectPublicKey = Key}) ->
      {Key, Params}.
  
  other_issuer(OtpCert, BinCert, CertDbHandle, CertDbRef) ->
      case public_key:pkix_issuer_id(OtpCert, other) of
  	{ok, IssuerId} ->
  	    {other, IssuerId};
  	{error, issuer_not_found} ->
  	    case find_issuer(OtpCert, BinCert, CertDbHandle, CertDbRef, []) of
  		{ok, IssuerId} ->
  		    {other, IssuerId};
  		Other ->
  
negative.code:                     maybe_shorten_path(Path, PartialChainHandler, {unknown_ca, Path})
              end;
          false ->
              case other_issuer(Cert, CertDbHandle, CertDbRef) of
                  {other, {SerialNr, IssuerId}} ->
                      case ssl_manager:lookup_trusted_cert(CertDbHandle, CertDbRef, SerialNr, IssuerId) of
                          {ok, {NewDer, NewOtp}} ->
  