문제

I am using gss_import_name on the client side using GSS_C_NT_HOSTBASED_SERVICE to get a principal like service/server-host@realm.

I am calling like this,

gss_import_name(status, "SERVICE", GSS_C_HOSTBASED_SERVICE, output_name);

But i get the principal like, service/local-machine@realm. From the man page I have learned it internally uses krb5_sname_to_principal to get the hostname, if NULL it takes the localhost name. Now my question is how do pass the correct host name (server-host) to gss-api to create the principal?

도움이 되었습니까?

해결책

I overlooked into it. To get the principal in the form 'service/server-host@realm' I should call

gss_import_name(status, "service@server-host", GSS_C_HOSTBASED_SERVICE, output_name);

instead of

gss_import_name(status, "service", GSS_C_HOSTBASED_SERVICE, output_name);

If the host name is missing then it assumes to be the local host name.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top