gpt4 book ai didi

c# - 使用 Xamarin 在可移植类库中保护 WCF 绑定(bind)

转载 作者:行者123 更新时间:2023-11-30 15:28:40 25 4
gpt4 key购买 nike

我有一个 WCF 服务,它有一个 WSHttpBinding。不幸的是,由于某种原因,在我的 PCL 中我无法使用 WSHttpBinding。我只能使用 BasicHttpBinding。有没有一种方法可以在可移植类库中使用安全绑定(bind)?我正在使用 Xamarin。

最佳答案

来自 Here我阅读了有关运输安全的信息:

Transport Security

When using transport security, the user credentialsand claims are passed by using the transport layer. In other words,user credentials are transport-dependent, which allows fewerauthentication options compared to message security. Each transportprotocol (TCP, IPC, MSMQ, or HTTP) has its own mechanism for passingcredentials and handling message protection. The most common approachfor this is to use Secure Sockets Layer (SSL) for encrypting andsigning the contents of the packets sent over Secure HTTP (HTTPS).Transport security is used to provide point-to-point security betweenthe two endpoints (service and client). If there are intermediarysystems between client and the service, each intermediate point mustforward the message over a new SSL connection.

我得出的结论是,PCL 的安全绑定(bind)是:

 BasicHttpBinding bind= new BasicHttpBinding(BasicHttpSecurityMode.Transport);

Web.config 绑定(bind):

  <basicHttpBinding>
<binding name="BasicSecure">
<security mode="Transport" />
</binding>
</basicHttpBinding>

关于c# - 使用 Xamarin 在可移植类库中保护 WCF 绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25284533/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com