To reiterate, RPC over HTTP is the best approach for making RPC calls over
the Internet. RPC over tcp/ip will almost certainly get blocked by the
firewalls and routers in some configurations. You will only be able to use
RPC over tcp/ip reliably over a LAN.
This having been said, if you insist on using tcp/ip, the documentation on
SSL support is very modest, so here's the rough outline of the steps:
On the client:
- Create a binding handle in the usual manner.
- Call CertOpenStore(), CertFindCertificateInStore() to load PCCERT_CONTEXT
you will use to authenticate the client.
- Initialize the SCHANNEL_CRED you will use for the client.
- Call RpcBindingSetAuthInfoEx() for your binding handle passing
RPC_C_AUTHN_GSS_SCHANNEL, and the SCHANNEL_CRED you created as the
AuthIdentity parameter.
- Make the call.
- Don't forget to cleanup by calling CertFreeCertificateContext() and
CertCloseStore().
On the server:
- Begin to initialize the server in the usual manner, but do not listen.
- Call CertOpenStore(), CertFindCertificateInStore() to load PCCERT_CONTEXT
you will use to authenticate the server.
- Initialize the SCHANNEL_CRED you will use for the server.
- Call RpcServerRegisterAuthInfo() passing RPC_C_AUTHN_GSS_SCHANNEL, and the
SCHANNEL_CRED you created as the Arg parameter.
- You may need to cleanup by calling CertFreeCertificateContext() and
CertCloseStore() if you unload your service from a running process.
You may want to consult the MSDN for additional RPC and SChannel info.
Greg
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Gianluca Braccinithanks for your answer, rpc over http is very interesting but increase the
throughput. I want only implementing certificate authentication with SSL,
but unlikely i cannot find a sample for RPC_C_AUTHN_GSS_SCHANNEL.
Gianluca
Post by S R TripathyRPC over HTTP may be your answer
Shakti
Post by Gianluca BracciniI use visual c/c++ rel. 6.0, i use RPC secure im my client/server
application. Now I would like to do a secure rpc connection over
internet
Post by S R TripathyPost by Gianluca Bracciniusing SSL, but where can I find some samples? I cannot understand how
to
Post by S R TripathyPost by Gianluca Bracciniset the parameters for RpcServerRegisterAuthInfo() when I specify
RPC_C_AUTHN_GSS_SCHANNEL. How can I set the SCHANNEL_CRED structure ? I
was
Post by Gianluca Braccinilooking for it in MSDN but I haven't found anything! Please help me