TL; DR - приложение WCF на IIS, серверном компоненте и клиентском компоненте рабочей станции ищет сертификат с отпечатком, срок действия которого истек, а впоследствии ему не доверяют.Не могу понять, где отключить проверку сертификата.
Длинные детали:
Я прочитал десятки статей о реализации SSL с WCF, но я не могу найти ни одной статьи, рассказывающей о заменеSSL-сертификат, используемый сервером WCF и клиентским приложением для проверки связи.
Я испытываю затруднения в связи с тем, что я работаю с программным обеспечением, которое год назад прекратило свое существование, и с информацией о наших клиентах.заблокирован внутри старого приложения.С тех пор мы перешли к новому поставщику для управления записями около двух лет назад, но мы возвращаемся к старой системе, чтобы время от времени ссылаться на информацию, так что система просто сидит в роли только для чтения.
Система управления записями состоит из ... - Внутренний сервер SQL - Внешний сервер IIS и службы приложений.Сервер IIS имеет несколько пулов приложений, работающих в режиме .NET 4.Все службы приложений - это службы Windows, которые запускаются автоматически при запуске сервера переднего плана.
Раньше эта система была подключена к Интернету, она больше не отключена, я отключил весь доступ к ней из внешнего мира.Вы должны быть в той же локальной сети или на консоли сервера переднего плана, чтобы использовать клиентское приложение.Поскольку раньше это было связано с Интернетом, оно было защищено с помощью SSL-сертификата от крупного ЦС и находилось в хорошем состоянии, пока две недели назад не истек срок действия SSL-сертификата.Теперь я получаю следующую ошибку при попытке запустить клиентское приложение ... "Ошибка проверки токена. Сертификат X.509 CN = fqdn_of_frontend_server, OU = CA_that_issued не удалось построить цепочку. Использованный сертификат имеет цепочку доверия, котораяне может быть проверено. Замените сертификат или измените CertificateValidationMode. Требуемый сертификат не находится в пределах его срока действия при проверке по текущим системным часам или отметке времени в подписанном файле. "
Прежде чем вы скажете ..."Почему бы просто не откатить системные часы приложения и серверов БД до времени, когда сертификат был действительным? "... потому что я не хочу вмешиваться каждый раз, когда один из 50 человек, имеющих клиентское приложение на своем компьютере, хочет его использовать.Неизбежно, что дата будет продолжать ползти после истекшей даты истечения срока действия SSL, и мы вроде как в регулируемой отрасли, поэтому, если бы аудиторы запрашивали журналы доступа к старой системе, а даты были неправильными, я бы искалновое задание.
Я купил новый доверенный сертификат CA SSL, установил его в IIS и привязал к веб-сайту по умолчанию (единственному сайту), на котором работают пулы приложений IIS.Это не сработало, клиентское приложение все еще ищет отпечаток старого сертификата SSL.
Итак, есть ли у этой стороны три стороны?Сервер переднего плана, на котором выполняются пулы приложений IIS и службы Windows, а последняя сторона - клиентское приложение.
Из файла сервера server..fif службы переднего плана Windows ...
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Mfg.Industry.BasicHttpBinding.Configuration.Open" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
<appSettings>
<add key="ConfigurationServiceUrl" value="http://fqdn_of_frontend_server/Name_of.ConfigurationService" />
<add key="ConfigurationServiceEncryptionKey" value="some_96_character_long_scrambled_key" />
<add key="ApplicationName" value="App Server" />
<add key="LocalHostName" value="fqdn_of_frontend_server" />
<add key="RedirectToLocalHost" value="False" />
<add key="WCF_STSConnection_Binding_Type" value="BasicHttpBinding" />
<add key="WCF_STSConnection_Binding_Configuration_Name" value="Mfg.Industry.BasicHttpBinding.Configuration.Open" />
<add key="WCF_InteractionProcessingConnection_Binding_Type" value="BasicHttpBinding" />
<add key="WCF_InteractionProcessingConnection_Binding_Configuration_Name" value="Mfg.Industry.BasicHttpBinding.Configuration.Open" />
<add key="FilterCheckPeriod" value="60" />
<add key="ACEVerificationPeriod" value="5" />
<add key="TestReachingQueueWaitingTime" value="500" />
<add key="ApplicationIdleTimeout" value="300" />
<add key="TestMessageSize" value="30" />
<add key="PRCServiceCalculationWaitingTime" value="1" />
<add key="PRCVerificationPeriod" value="1" />
<add key="CommunityWebsiteUrl" value="https://some_link_now_defunct_to_Mfg/Contact-Support/" />
<add key="ACTGVerificationPeriod" value="5" />
<add key="ACTG_AR_VerificationPeriod" value="5" />
</appSettings>
</configuration>
Из файла web.config пула приложений IIS сервера переднего плана ...
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<section name="ConfigurationService.Encryption" type="System.Configuration.NameValueSectionHandler" />
</configSections>
<appSettings configSource="AppSettings.config">
</appSettings>
<ConfigurationService.Encryption configProtectionProvider="RsaProtectedConfigurationProvider">
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>Rsa Key</KeyName>
</KeyInfo>
<CipherData>
<CipherValue>some_172_character_key</CipherValue>
</CipherData>
</EncryptedKey>
</KeyInfo>
<CipherData>
<CipherValue>some_460_character_key</CipherValue>
</CipherData>
</EncryptedData>
</ConfigurationService.Encryption>
<system.web>
<httpCookies httpOnlyCookies="true" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="20" slidingExpiration="true" />
</authentication>
<sessionState mode="InProc" timeout="20" />
<!--<customErrors mode="On" defaultRedirect="Error"/>-->
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="RoleManager" />
</modules>
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<defaultDocument>
<files>
<clear />
<add value="" />
</files>
</defaultDocument>
</system.webServer>
<runtime>
omitted
</runtime>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAuthentication" />
<binding name="BasicHttpBinding_ICertificateValidator" />
<binding name="BasicHttpBinding_IAuthorization" />
<binding name="SecurityFrameworkSoap" />
<binding name="SecurityAdministrationSoap" />
<binding name="SecurityPolicySoap" />
<binding name="SecuritySynchronizationSoap" />
</basicHttpBinding>
</bindings>
<client>
<endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAuthentication" contract="StsAuthentication.IAuthentication" name="BasicHttpBinding_IAuthentication" />
<endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAuthorization" contract="STSAuthorization.IAuthorization" name="BasicHttpBinding_IAuthorization" />
<endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICertificateValidator" contract="STSCertVldtr.ICertificateValidator" name="BasicHttpBinding_ICertificateValidator" />
<endpoint binding="basicHttpBinding" bindingConfiguration="SecurityAdministrationSoap" contract="SecAdmin.SecurityAdministrationSoap" name="SecurityAdministrationSoap" />
<endpoint binding="basicHttpBinding" bindingConfiguration="SecurityPolicySoap" contract="SecPolicy.SecurityPolicySoap" name="SecurityPolicySoap" />
<endpoint binding="basicHttpBinding" bindingConfiguration="SecuritySynchronizationSoap" contract="SecSync.SecuritySynchronizationSoap" name="SecuritySynchronizationSoap" />
<endpoint binding="basicHttpBinding" bindingConfiguration="SecurityFrameworkSoap" contract="SF.SecurityFrameworkSoap" name="SecurityFrameworkSoap" />
</client>
</system.serviceModel>
</configuration>
Из файла appname.exe.config клиентского приложения ...
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0ccaa1d06491a513" />
<section name="securityCryptographyConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration.CryptographySettings, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0ccaa1d06491a513" />
<section name="informationMonitoringSynchronization" type="System.Configuration.NameValueFileSectionHandler" />
<section name="assembliesToJIT" type="System.Configuration.NameValueFileSectionHandler" />
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0ccaa1d06491a513" />
</configSections>
<appSettings>
<add key="WCF_Base_URL" value="net.tcp://localhost:{0}/Allscripts.Homecare/Services/{1}/{2}" />
<add key="WCF_Hosting_Binding_Configuration_Name" value="Mfg.Industry.NetTcpBinding.Configuration.Open" />
<add key="WCF_Hosting_Binding_Type" value="NetTcpBinding" />
<add key="SLPingTimeout" value="2" />
<add key="WCF_Hosting_Start_Port" value="2222" />
<add key="WCF_Hosting_End_Port" value="9199" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin" />
</assemblyBinding>
</runtime>
<exceptionHandling>
<exceptionPolicies>
<add name="Authentication Exception Policy">
<exceptionTypes>
<add name="AuthenticationException" type="Mfg.Industry.Security.Framework.Facade.AuthenticationException, Mfg.Industry.Security.Framework.Facade, Version=17.2.0.163, Culture=neutral, PublicKeyToken=c5afe0c9031f3768" postHandlingAction="NotifyRethrow">
<exceptionHandlers />
</add>
<add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow">
<exceptionHandlers />
</add>
</exceptionTypes>
</add>
<add name="Unhandled Exception Policy">
<exceptionTypes>
<add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow">
<exceptionHandlers>
</exceptionHandlers>
</add>
<add name="IndustryException" type="Mfg.Industry.IndustryException, Mfg.Industry.Lib, Version=17.2.0.163, Culture=neutral, PublicKeyToken=c5afe0c9031f3768" postHandlingAction="NotifyRethrow">
<exceptionHandlers>
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
<add name="User Services Exception Policy">
<exceptionTypes>
<add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None">
<exceptionHandlers>
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
</exceptionPolicies>
</exceptionHandling>
<securityCryptographyConfiguration>
<hashProviders>
<add algorithmType="System.Security.Cryptography.MD5CryptoServiceProvider, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" saltEnabled="false" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.HashAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="MD5CryptoServiceProvider" />
</hashProviders>
</securityCryptographyConfiguration>
<informationMonitoringSynchronization>
<add key="BatchSize" value="15" />
<add key="CompressionEnabled" value="True" />
<add key="MultithreadingEnabled" value="False" />
</informationMonitoringSynchronization>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
<assembliesToJIT>
<add key="MfgIndustrySecurityCommon" value="Mfg.Industry.Security.Common" />
<add key="MfgIndustrySecurityFramework" value="Mfg.Industry.Security.Framework" />
<add key="MfgIndustrySecurityWebServicesClient" value="Mfg.Industry.Security.WebServices.Client" />
<add key="MfgIndustrySecurityFrameworkFacade" value="Mfg.Industry.Security.Framework.Facade" />
<add key="MfgIndustrySecurityAdministrationCommon" value="Mfg.Industry.Security.Administration.Common" />
<add key="MfgIndustrySynchronization" value="Mfg.Industry.Synchronization" />
<add key="MfgIndustrySynchronizationData" value="Mfg.Industry.Synchronization.Data" />
<add key="MfgIndustryDFAClient" value="Mfg.Industry.DFA.Client" />
<add key="MfgIndustryDFAFramework" value="Mfg.Industry.DFA.Framework" />
<add key="EligibilityWebClient" value="Mfg.Industry.Eligibility.WebClient" />
<add key="InformationMonitoring" value="Mfg.Industry.InformationMonitoring" />
<add key="EligibilityClient" value="Mfg.Industry.Eligibility.Client" />
<add key="SplitBillingRule" value="Mfg.Industry.SplitBillingRule" />
<add key="EventManagerClient" value="Mfg.Industry.EventManager.Client" />
<add key="MfgIndustrySanctionImportClient" value="Mfg.Industry.SanctionImport.Client" />
<add key="MfgIndustryTestInterfaces" value="Mfg.Industry.TestInterfaces" />
<add key="MfgIndustryOpenAPIClient" value="Mfg.Industry.OpenAPI.Client" />
<add key="MfgIndustryCommonDefinitionData" value="Mfg.Industry.Common.DefinitionData" />
<add key="InfomaticsMisc" value="Infomatics2.Win.Misc.v6.1, Version=6.1.20061.28, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" />
<add key="InfomaticsGrid" value="Infomatics2.Win.UltraWinGrid.v6.1, Version=6.1.20061.28, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" />
<add key="InfomaticsEditors" value="Infomatics2.Win.UltraWinEditors.v6.1, Version=6.1.20061.28, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" />
<add key="InfomaticsFolio" value="Infomatics2.Win.UltraWinFolio.v6.1, Version=6.1.20061.28, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" />
<add key="InfomaticsFolio63" value="Infomatics2.Win.UltraWinFolio.v6.3, Version=6.3.20063.1091, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" />
<add key="InfomaticsTab" value="Infomatics2.Win.UltraWinTabControl.v6.1, Version=6.1.20061.28, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" />
<add key="InfomaticsWin" value="Infomatics2.Win.v6.1, Version=6.1.20061.28, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" />
<add key="InfomaticsTree" value="Infomatics2.Win.UltraWinTree.v6.1, Version=6.1.20061.28, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" />
<add key="InfomaticsShared" value="Infomatics2.Shared.v6.1, Version=6.1.20061.28, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" />
<add key="DevExpressUtils" value="DevExpress.Utils, Version=2.1.4.0, Culture=neutral, PublicKeyToken=79868b8147b5eae4" />
<add key="DevExpressEditors" value="DevExpress.XtraEditors, Version=2.1.4.0, Culture=neutral, PublicKeyToken=79868b8147b5eae4" />
<add key="CommonControls" value="Mfg.Industry.Forms.Controls" />
<add key="MfgIndustryDFAClientData" value="Mfg.Industry.DFA.Client.Data" />
<add key="MfgIndustryDFAClientDataFacade" value="Mfg.Industry.DFA.Client.Data.Facade" />
<add key="MfgIndustryDFAClientSharedInterfaces" value="Mfg.Industry.DFA.Client.SharedInterfaces" />
<add key="InformationMonitoringData" value="Mfg.Industry.InformationMonitoring.Data" />
<add key="Eligibility" value="Mfg.Industry.Eligibility" />
<add key="EligibilityCommon" value="Mfg.Industry.Eligibility.Common" />
<add key="OnboardAndStatusConfiguration" value="Mfg.Industry.EventManager.OnboardAndStatusConfiguration" />
<add key="EventManagerClientCommon" value="Mfg.Industry.EventManager.Client.Common" />
<add key="EventManagerCommon" value="Mfg.Industry.EventManager.Common" />
<add key="MfgIndustryFormsControls" value="Mfg.Industry.Forms.Controls" />
<add key="MfgIndustryHelpManagerHelpClient" value="Mfg.Industry.HelpManager.HelpClient" />
<add key="MfgIndustryPayrollCommon" value="Mfg.Industry.Payroll.Common" />
<add key="MfgIndustryReportCommon" value="Mfg.Industry.Report.Common" />
</assembliesToJIT>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="Mfg.Industry.NetTcpBinding.Configuration.Open" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
<loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
<listeners>
<add listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.CustomTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0ccaa1d06491a513" traceOutputOptions="None" type="Mfg.Industry.Plugin.Diagnostics.DebugTraceListener, Mfg.Industry.Plugin.Diagnostics" name="DebugTraceListener" initializeData="" formatter="" />
</listeners>
<categorySources>
<add switchValue="All" name="General" />
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events">
<listeners>
<add name="DebugTraceListener" />
</listeners>
</allEvents>
<notProcessed switchValue="All" name="Unprocessed Category" />
<errors switchValue="All" name="Logging Errors & Warnings" />
</specialSources>
</loggingConfiguration>
</configuration>
Какие файлы выполняютсяМне нужно изменить, чтобы просто отключить проверку сертификата WCF?Я пробовал что-то вроде ...
<configuration>
<system.net>
<settings>
<servicePointManager checkCertificateName="false" checkCertificateRevocationList="false" />
</settings>
</system.net>
</configuration>
И я продолжаю сталкиваться с дорожными преградами.В конечном итоге я хотел бы использовать новый купленный SSL-сертификат, но это означает, что мне придется когда-нибудь снова пройти через этот процесс, поэтому я мог бы просто полностью отключить проверку сертификата.