Error 1001 неизвестная ошибка 0x80005000

I get the following error when I install a web application. I experienced this kind error only in my machine. I checked with admin privileges, but no hope.

OS — Windows 7, 64 bit

enter image description here

enter image description here

After ‘Error 2’, the installer is rolling back !

  • asp.net
  • permissions
  • installation

asked Jan 18, 2012 at 8:49

Rauf's user avatar

RaufRauf

12.3k20 gold badges78 silver badges126 bronze badges

5

  • Run your setup with admin privileges.

    Jan 18, 2012 at 8:50

  • @AVD I checked it with admin privileges, but no hope.

    Jan 18, 2012 at 8:59

  • @AVD Great ! It worked. Please post it as answer. I will vote and then accept it :)

    Jan 18, 2012 at 11:04

  • Great! How did you solve? Have you turn on IIS compatibility features?

    Jan 18, 2012 at 12:20

1 Answer

answered Jan 18, 2012 at 12:45

Rauf's user avatar

RaufRauf

12.3k20 gold badges78 silver badges126 bronze badges

I get the following error when I install a web application. I experienced this kind error only in my machine. I checked with admin privileges, but no hope.

OS — Windows 7, 64 bit

enter image description here

enter image description here

After ‘Error 2’, the installer is rolling back !

  • asp.net
  • permissions
  • installation

asked Jan 18, 2012 at 8:49

Rauf's user avatar

RaufRauf

12.2k19 gold badges76 silver badges125 bronze badges

5

  • Run your setup with admin privileges.

    Jan 18, 2012 at 8:50

  • @AVD I checked it with admin privileges, but no hope.

    Jan 18, 2012 at 8:59

  • @AVD Great ! It worked. Please post it as answer. I will vote and then accept it :)

    Jan 18, 2012 at 11:04

  • Great! How did you solve? Have you turn on IIS compatibility features?

    Jan 18, 2012 at 12:20

1 Answer

answered Jan 18, 2012 at 12:45

Rauf's user avatar

RaufRauf

12.2k19 gold badges76 silver badges125 bronze badges

Oh…

This is odd.

This is annoying.

When I tried to install a web application, I got the following errors.

and

Then, the installed would rollback.

Solution

To solve this, we have to do nothing but update your IIS to install ‘IIS 6 Management Compatibility’

To do so, go to

Control PanelAll Control Panel ItemsPrograms and Features

Then click on Turn Windows features on or off

Then check the following under IIS

Well. You done it 🙂

Advertisement

Я застрял в течение последних нескольких часов на раздражающем бит Active Directory.

Я пытаюсь подключиться к Active Directory через LDAP через SSL. Тип аутентификации-анонимный. Я использую .NET Framework 4.0, C# и Visual Studio 2010.

следующий код должен работать в соответствии с различными онлайн-ресурсами. Но он продолжает придумывать удивительную самоочевидную: «неизвестная ошибка (0x80005000)».

DirectoryEntry entry = new DirectoryEntry();
entry.Path = "LDAPS://some.ldap.server:636";
entry.AuthenticationType = AuthenticationTypes.SecureSocketsLayer;

DirectorySearcher searcher = new DirectorySearcher();
searcher.searchRoot = entry;
searcher.Filter = "(&(objectCategory=person)(objectClass=user))";

SearchResultCollection results = searcher.FindAll();

Я упрощенный фактический запрос, который я хочу выполнить, к тому, который вы найдете в коде. Но даже с этим общим запросом (он должен возвращать работу над каждым объявлением?) возвращает ошибку.

3 ответов


наконец-то!

кажется, что ASP.NET приложение не имеет прав (или не знает, как) для проверки доверенного хранилища сертификатов на уровне компьютера. Поскольку сертификат был самоподписан, ASP.NET в заявлении отказано в установлении связи.

я исправил проблему с помощью пользовательской проверки сертификата.
Следующий код сделал трюк:

LdapConnection con = new LdapConnection(new LdapDirectoryIdentifier("server", port));
con.SessionOptions.SecureSocketLayer = true;
con.SessionOptions.VerifyServerCertificate = new VerifyServerCertificateCallback(ServerCallback);
con.Credential = new NetworkCredential(String.Empty, String.Empty);
con.AuthType = AuthType.Basic;
con.Bind();

поскольку я уверен, что сертификат действителен, метод ServerCallBack выглядит так это:

public static bool ServerCallBack(LdapConnection connection, X509Certificate certificate)
{
    return true;
}

но вы всегда можете, конечно, получить сертификат с локального компьютера и проверить его.

пространство имен, используемое в этом примере:

System.DirectoryServices.Protocols;

это потому, что пространство имен:

System.DirectoryServices.DirectoryEntry

не содержит метода для проверки пользовательского сертификата.

спасибо всем за вашу помощь и время, и, надеюсь, это поможет кому-то в будущем!


насколько я помню, эта ошибка означает, что есть проблема с именем каталог.

  1. убедитесь, что » сервер.domainName » — это CN в сертификате вашего сервера AD.
  2. убедитесь, что » некоторые.domainName » хорошо разрешен добавьте разрешение в файл hosts для теста
  3. убедитесь, что» domainName » хорошо разрешен добавьте разрешение в файл hosts для теста
  4. убедитесь, что публичный ke центр сертификации, выдающий сертификат сервера, находится в хранилище доверенного корневого центра сертификации компьютера.
  5. попробуйте сделать так :

DirectoryEntry entry = new DirectoryEntry("LDAPS://srventr2.societe.fr:636/DC=societe,DC=fr", "user", "password");

DirectorySearcher searcher = new DirectorySearcher();
searcher.SearchRoot = entry;
searcher.SearchScope = SearchScope.Subtree;
searcher.Filter = "(&(objectCategory=person)(objectClass=user))";
SearchResultCollection results = searcher.FindAll(); 

в зависимости от того, как настроен ваш сервер каталогов(или элементы в вашей сети), иногда простое изменение, такое как это, будет работать (LDAP против LDAPS, но оставьте номер порта)

entry.Path = "LDAP://some.ldap.server:636";

0 / 0 / 0

Регистрация: 11.08.2015

Сообщений: 2

1

22.05.2016, 23:59. Показов 2280. Ответов 1


Студворк — интернет-сервис помощи студентам

день добрый! объясните, пожалуйста, чайнику как побороть ошибку (неизвестная ошибка (0x80005000)) при получении списка групп у пользователя. она появляется когда используешь GetGroups, причем исключение вылетает после первого прохождения по циклу, если использовать GetAuthorizationGroups, то ошибки нету и в цикл попадает весь список групп. ошибка появляется не на всех пользователях, а только на некоторых. вот кусок кода:

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
try
         {
             UserPrincipal user = UserPrincipal.FindByIdentity(new PrincipalContext(ContextType.Domain, sDomain), IdentityType.SamAccountName, sUserName);
             //if (user.GetAuthorizationGroups() != null)
               if (user.GetGroups() != null)
 
             //foreach (var  group in user.GetAuthorizationGroups())
             foreach (var group in user.GetGroups())
             {                    
                     string gr = group.ToString();
 
                     string sql_ins = string.Format("INSERT INTO AD" + "(fio, login, gr, download_dat, ou, fil) VALUES(@fio, @login, @gr, @dat, @ou, @filial)");
 
                 using (SqlCommand cmd = new SqlCommand(sql_ins, sql.cn))
                 {
                     sql.SQLOpenConnect();
                     // Добавить параметры
                     cmd.Parameters.AddWithValue("@fio", name);
                     cmd.Parameters.AddWithValue("@login", sUserName);
                     cmd.Parameters.AddWithValue("@gr", gr);
                     cmd.Parameters.AddWithValue("@dat", dat);
                     cmd.Parameters.AddWithValue("@ou", ou);
                     cmd.Parameters.AddWithValue("@filial", filial);
 
                     cmd.ExecuteNonQuery();
                     sql.SQLCloseConnect();
                 }
             }
         }
                catch (System.NullReferenceException ex)
                {
                    MessageBox.Show(ex.Message, "Error!");
                }
            }

0

It’s a permission problem.

When you run the console app, that app runs with your credentials, e.g. as «you».

The WCF service runs where? In IIS? Most likely, it runs under a separate account, which is not permissioned to query Active Directory.

You can either try to get the WCF impersonation thingie working, so that your own credentials get passed on, or you can specify a username/password on creating your DirectoryEntry:

DirectoryEntry directoryEntry = 
    new DirectoryEntry("LDAP://someserver.contoso.com/DC=contoso,DC=com", 
                       userName, password);

OK, so it might not be the credentials after all (that’s usually the case in over 80% of the cases I see).

What about changing your code a little bit?

DirectorySearcher directorySearcher = new DirectorySearcher(directoryEntry);
directorySearcher.Filter = string.Format("(&(objectClass=user)(objectCategory=user) (sAMAccountName={0}))", username);

directorySearcher.PropertiesToLoad.Add("msRTCSIP-PrimaryUserAddress");

var result = directorySearcher.FindOne();

if(result != null)
{
   if(result.Properties["msRTCSIP-PrimaryUserAddress"] != null)
   {
      var resultValue = result.Properties["msRTCSIP-PrimaryUserAddress"][0];
   }
}

My idea is: why not tell the DirectorySearcher right off the bat what attribute you’re interested in? Then you don’t need to do another extra step to get the full DirectoryEntry from the search result (should be faster), and since you told the directory searcher to find that property, it’s certainly going to be loaded in the search result — so unless it’s null (no value set), then you should be able to retrieve it easily.

Marc

Oh…

This is odd.

This is annoying.

When I tried to install a web application, I got the following errors.

and

Then, the installed would rollback.

Solution

To solve this, we have to do nothing but update your IIS to install ‘IIS 6 Management Compatibility’

To do so, go to

Control Panel\All Control Panel Items\Programs and Features

Then click on Turn Windows features on or off

Then check the following under IIS

Well. You done it 🙂

Я застрял в течение последних нескольких часов на раздражающем бит Active Directory.

Я пытаюсь подключиться к Active Directory через LDAP через SSL. Тип аутентификации-анонимный. Я использую .NET Framework 4.0, C# и Visual Studio 2010.

следующий код должен работать в соответствии с различными онлайн-ресурсами. Но он продолжает придумывать удивительную самоочевидную: «неизвестная ошибка (0x80005000)».

DirectoryEntry entry = new DirectoryEntry();
entry.Path = "LDAPS://some.ldap.server:636";
entry.AuthenticationType = AuthenticationTypes.SecureSocketsLayer;

DirectorySearcher searcher = new DirectorySearcher();
searcher.searchRoot = entry;
searcher.Filter = "(&(objectCategory=person)(objectClass=user))";

SearchResultCollection results = searcher.FindAll();

Я упрощенный фактический запрос, который я хочу выполнить, к тому, который вы найдете в коде. Но даже с этим общим запросом (он должен возвращать работу над каждым объявлением?) возвращает ошибку.

3 ответов


наконец-то!

кажется, что ASP.NET приложение не имеет прав (или не знает, как) для проверки доверенного хранилища сертификатов на уровне компьютера. Поскольку сертификат был самоподписан, ASP.NET в заявлении отказано в установлении связи.

я исправил проблему с помощью пользовательской проверки сертификата.
Следующий код сделал трюк:

LdapConnection con = new LdapConnection(new LdapDirectoryIdentifier("server", port));
con.SessionOptions.SecureSocketLayer = true;
con.SessionOptions.VerifyServerCertificate = new VerifyServerCertificateCallback(ServerCallback);
con.Credential = new NetworkCredential(String.Empty, String.Empty);
con.AuthType = AuthType.Basic;
con.Bind();

поскольку я уверен, что сертификат действителен, метод ServerCallBack выглядит так это:

public static bool ServerCallBack(LdapConnection connection, X509Certificate certificate)
{
    return true;
}

но вы всегда можете, конечно, получить сертификат с локального компьютера и проверить его.

пространство имен, используемое в этом примере:

System.DirectoryServices.Protocols;

это потому, что пространство имен:

System.DirectoryServices.DirectoryEntry

не содержит метода для проверки пользовательского сертификата.

спасибо всем за вашу помощь и время, и, надеюсь, это поможет кому-то в будущем!


насколько я помню, эта ошибка означает, что есть проблема с именем каталог.

  1. убедитесь, что » сервер.domainName » — это CN в сертификате вашего сервера AD.
  2. убедитесь, что » некоторые.domainName » хорошо разрешен добавьте разрешение в файл hosts для теста
  3. убедитесь, что» domainName » хорошо разрешен добавьте разрешение в файл hosts для теста
  4. убедитесь, что публичный ke центр сертификации, выдающий сертификат сервера, находится в хранилище доверенного корневого центра сертификации компьютера.
  5. попробуйте сделать так :

DirectoryEntry entry = new DirectoryEntry("LDAPS://srventr2.societe.fr:636/DC=societe,DC=fr", "user", "password");

DirectorySearcher searcher = new DirectorySearcher();
searcher.SearchRoot = entry;
searcher.SearchScope = SearchScope.Subtree;
searcher.Filter = "(&(objectCategory=person)(objectClass=user))";
SearchResultCollection results = searcher.FindAll(); 

в зависимости от того, как настроен ваш сервер каталогов(или элементы в вашей сети), иногда простое изменение, такое как это, будет работать (LDAP против LDAPS, но оставьте номер порта)

entry.Path = "LDAP://some.ldap.server:636";

I get the following error when I install a web application. I experienced this kind error only in my machine. I checked with admin privileges, but no hope.

OS — Windows 7, 64 bit

enter image description here

enter image description here

After ‘Error 2’, the installer is rolling back !

  • asp.net
  • permissions
  • installation

asked Jan 18, 2012 at 8:49

Rauf's user avatar

RaufRauf

12.2k19 gold badges76 silver badges124 bronze badges

5

  • Run your setup with admin privileges.

    Jan 18, 2012 at 8:50

  • @AVD I checked it with admin privileges, but no hope.

    Jan 18, 2012 at 8:59

  • @AVD Great ! It worked. Please post it as answer. I will vote and then accept it :)

    Jan 18, 2012 at 11:04

  • Great! How did you solve? Have you turn on IIS compatibility features?

    Jan 18, 2012 at 12:20

1 Answer

answered Jan 18, 2012 at 12:45

Rauf's user avatar

RaufRauf

12.2k19 gold badges76 silver badges124 bronze badges

I get the following error when I install a web application. I experienced this kind error only in my machine. I checked with admin privileges, but no hope.

OS — Windows 7, 64 bit

enter image description here

enter image description here

After ‘Error 2’, the installer is rolling back !

  • asp.net
  • permissions
  • installation

asked Jan 18, 2012 at 8:49

Rauf's user avatar

RaufRauf

12.2k19 gold badges76 silver badges124 bronze badges

5

  • Run your setup with admin privileges.

    Jan 18, 2012 at 8:50

  • @AVD I checked it with admin privileges, but no hope.

    Jan 18, 2012 at 8:59

  • @AVD Great ! It worked. Please post it as answer. I will vote and then accept it :)

    Jan 18, 2012 at 11:04

  • Great! How did you solve? Have you turn on IIS compatibility features?

    Jan 18, 2012 at 12:20

1 Answer

answered Jan 18, 2012 at 12:45

Rauf's user avatar

RaufRauf

12.2k19 gold badges76 silver badges124 bronze badges

It’s a permission problem.

When you run the console app, that app runs with your credentials, e.g. as «you».

The WCF service runs where? In IIS? Most likely, it runs under a separate account, which is not permissioned to query Active Directory.

You can either try to get the WCF impersonation thingie working, so that your own credentials get passed on, or you can specify a username/password on creating your DirectoryEntry:

DirectoryEntry directoryEntry = 
    new DirectoryEntry("LDAP://someserver.contoso.com/DC=contoso,DC=com", 
                       userName, password);

OK, so it might not be the credentials after all (that’s usually the case in over 80% of the cases I see).

What about changing your code a little bit?

DirectorySearcher directorySearcher = new DirectorySearcher(directoryEntry);
directorySearcher.Filter = string.Format("(&(objectClass=user)(objectCategory=user) (sAMAccountName={0}))", username);

directorySearcher.PropertiesToLoad.Add("msRTCSIP-PrimaryUserAddress");

var result = directorySearcher.FindOne();

if(result != null)
{
   if(result.Properties["msRTCSIP-PrimaryUserAddress"] != null)
   {
      var resultValue = result.Properties["msRTCSIP-PrimaryUserAddress"][0];
   }
}

My idea is: why not tell the DirectorySearcher right off the bat what attribute you’re interested in? Then you don’t need to do another extra step to get the full DirectoryEntry from the search result (should be faster), and since you told the directory searcher to find that property, it’s certainly going to be loaded in the search result — so unless it’s null (no value set), then you should be able to retrieve it easily.

Marc

0 / 0 / 0

Регистрация: 11.08.2015

Сообщений: 2

1

22.05.2016, 23:59. Показов 2185. Ответов 1


день добрый! объясните, пожалуйста, чайнику как побороть ошибку (неизвестная ошибка (0x80005000)) при получении списка групп у пользователя. она появляется когда используешь GetGroups, причем исключение вылетает после первого прохождения по циклу, если использовать GetAuthorizationGroups, то ошибки нету и в цикл попадает весь список групп. ошибка появляется не на всех пользователях, а только на некоторых. вот кусок кода:

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
try
         {
             UserPrincipal user = UserPrincipal.FindByIdentity(new PrincipalContext(ContextType.Domain, sDomain), IdentityType.SamAccountName, sUserName);
             //if (user.GetAuthorizationGroups() != null)
               if (user.GetGroups() != null)
 
             //foreach (var  group in user.GetAuthorizationGroups())
             foreach (var group in user.GetGroups())
             {                    
                     string gr = group.ToString();
 
                     string sql_ins = string.Format("INSERT INTO AD" + "(fio, login, gr, download_dat, ou, fil) VALUES(@fio, @login, @gr, @dat, @ou, @filial)");
 
                 using (SqlCommand cmd = new SqlCommand(sql_ins, sql.cn))
                 {
                     sql.SQLOpenConnect();
                     // Добавить параметры
                     cmd.Parameters.AddWithValue("@fio", name);
                     cmd.Parameters.AddWithValue("@login", sUserName);
                     cmd.Parameters.AddWithValue("@gr", gr);
                     cmd.Parameters.AddWithValue("@dat", dat);
                     cmd.Parameters.AddWithValue("@ou", ou);
                     cmd.Parameters.AddWithValue("@filial", filial);
 
                     cmd.ExecuteNonQuery();
                     sql.SQLCloseConnect();
                 }
             }
         }
                catch (System.NullReferenceException ex)
                {
                    MessageBox.Show(ex.Message, "Error!");
                }
            }

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

0

  • Remove From My Forums
  • Question

  • I am currently trying to setup a windows 2012 R2 Cluster, which will eventually have SQL.  So far I have done the hardware setup, so that it has access to shared disk, network, etc.  The only issue is that currently I am getting the following error
    when running the cluster validator.

    The service principal names (SPNs) of node $NODENAME could not be determined because of this error: Unknown error (0x80005000)

    I get this error under System Configuration > Validate Active Directory Configuration.  And the user I am using to run this is a domain admin, so it should have full rights.

    I feel like I am missing something basic, but cannot figure out what it is.

    Thanks in advance.

    • Edited by

      Friday, February 7, 2014 5:18 PM
      Removed node name

Answers

  • So I was able to determine the issue, and this is probably a bug of some sort.

    The Sub-OU I had them in had a «/» in its name, which is what was causing the issue.  After removing the «/» it worked fine.  Clearly it was not a good idea to have that in there, but hopefully if anyone sees this in the future they will not make
    the same mistake.

    • Marked as answer by
      Nicholas A
      Thursday, March 6, 2014 5:39 PM
  • Remove From My Forums
  • Question

  • I am currently trying to setup a windows 2012 R2 Cluster, which will eventually have SQL.  So far I have done the hardware setup, so that it has access to shared disk, network, etc.  The only issue is that currently I am getting the following error
    when running the cluster validator.

    The service principal names (SPNs) of node $NODENAME could not be determined because of this error: Unknown error (0x80005000)

    I get this error under System Configuration > Validate Active Directory Configuration.  And the user I am using to run this is a domain admin, so it should have full rights.

    I feel like I am missing something basic, but cannot figure out what it is.

    Thanks in advance.

    • Edited by

      Friday, February 7, 2014 5:18 PM
      Removed node name

Answers

  • So I was able to determine the issue, and this is probably a bug of some sort.

    The Sub-OU I had them in had a «/» in its name, which is what was causing the issue.  After removing the «/» it worked fine.  Clearly it was not a good idea to have that in there, but hopefully if anyone sees this in the future they will not make
    the same mistake.

    • Marked as answer by
      Nicholas A
      Thursday, March 6, 2014 5:39 PM

I have been trying to find an answer to my problem, and the closest on these forums I could find was this post: 

However, while we’re getting the same error, mine stems from something a little different… I think.

I have a VB.Net app that uses Directory Services to create several Virtual Directories in IIS.  This app work perfectly, without error or exception of any kind on 32bit machines (XP, Vista, Server2003, Server2008, etc.) running IIS5/6/7. However, when I run the app (making no code changes) on our first 64bit test machine, a Win Server 2008 R2 64bit with IIS7.5, it throws a «System.Runtime.InteropServices.COMException» exception.

The method executed when the exception is thrown (the «If DirectoryEntry.Exists()…» line is what I believe is throwing the exception):

        Public Sub CreateVirtualDirectory(ByVal IISPath As String, ByVal PhysicalPath As String, ByVal FolderName As String, ByVal AccessRead As Boolean, ByVal AccessWrite As Boolean, ByVal AccessSource As Boolean, ByVal AccessScript As Boolean, ByVal AccessExecute As Boolean, Optional ByVal SetAsApplication As Boolean = False)

            Try

                Dim Parent As New DirectoryEntry(IISPath)

                Dim NewVirtualDirectory As DirectoryEntry

                ‘ Remove the directory if it exists

                If DirectoryEntry.Exists(IISPath & «/» & FolderName) Then

                    Dim parms As Object() = {«IIsWebVirtualDir», FolderName}

                    Parent.Invoke(«Delete», parms)

                End If

                ‘ Create the virtual directory with specified settings

                NewVirtualDirectory = Parent.Children.Add(FolderName, «IIsWebVirtualDir»)

                With NewVirtualDirectory

                    If SetAsApplication Then

                        .Invoke(«AppCreate2», 2)

                        .Properties(«AppFriendlyName»)(0) = FolderName

                    End If

                    .Properties(«Path»)(0) = PhysicalPath

                    .Properties(«AccessScript»)(0) = AccessScript

                    .Properties(«AccessSource»)(0) = AccessSource

                    .Properties(«AccessRead»)(0) = AccessRead

                    .Properties(«AccessWrite»)(0) = AccessWrite

                    .Properties(«AccessExecute»)(0) = AccessExecute

                    .CommitChanges()

                    ‘If SetAsApplication Then

                    ‘End If

                End With

            Catch ex As Exception

                Throw New Exception(«CreateVirtualDirectory() Failed:» & vbCrLf & ex.ToString)

            End Try

        End Sub

And this is the exception:

System.Exception: CreateVirtualDirectory() Failed:

System.Runtime.InteropServices.COMException (0x80005000): Unknown error (0x80005000)

   at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)

   at System.DirectoryServices.DirectoryEntry.Exists(String path)

This code works fine on every other (32bit) machine we’ve tested, but now bombs on a 64bit. What’s the problem here?

— Andrew

Я застрял в течение последних нескольких часов на раздражающем бит Active Directory.

Я пытаюсь подключиться к Active Directory через LDAP через SSL. Тип аутентификации-анонимный. Я использую .NET Framework 4.0, C# и Visual Studio 2010.

следующий код должен работать в соответствии с различными онлайн-ресурсами. Но он продолжает придумывать удивительную самоочевидную: «неизвестная ошибка (0x80005000)».

DirectoryEntry entry = new DirectoryEntry();
entry.Path = "LDAPS://some.ldap.server:636";
entry.AuthenticationType = AuthenticationTypes.SecureSocketsLayer;

DirectorySearcher searcher = new DirectorySearcher();
searcher.searchRoot = entry;
searcher.Filter = "(&(objectCategory=person)(objectClass=user))";

SearchResultCollection results = searcher.FindAll();

Я упрощенный фактический запрос, который я хочу выполнить, к тому, который вы найдете в коде. Но даже с этим общим запросом (он должен возвращать работу над каждым объявлением?) возвращает ошибку.

3 ответов


наконец-то!

кажется, что ASP.NET приложение не имеет прав (или не знает, как) для проверки доверенного хранилища сертификатов на уровне компьютера. Поскольку сертификат был самоподписан, ASP.NET в заявлении отказано в установлении связи.

я исправил проблему с помощью пользовательской проверки сертификата.
Следующий код сделал трюк:

LdapConnection con = new LdapConnection(new LdapDirectoryIdentifier("server", port));
con.SessionOptions.SecureSocketLayer = true;
con.SessionOptions.VerifyServerCertificate = new VerifyServerCertificateCallback(ServerCallback);
con.Credential = new NetworkCredential(String.Empty, String.Empty);
con.AuthType = AuthType.Basic;
con.Bind();

поскольку я уверен, что сертификат действителен, метод ServerCallBack выглядит так это:

public static bool ServerCallBack(LdapConnection connection, X509Certificate certificate)
{
    return true;
}

но вы всегда можете, конечно, получить сертификат с локального компьютера и проверить его.

пространство имен, используемое в этом примере:

System.DirectoryServices.Protocols;

это потому, что пространство имен:

System.DirectoryServices.DirectoryEntry

не содержит метода для проверки пользовательского сертификата.

спасибо всем за вашу помощь и время, и, надеюсь, это поможет кому-то в будущем!


насколько я помню, эта ошибка означает, что есть проблема с именем каталог.

  1. убедитесь, что » сервер.domainName » — это CN в сертификате вашего сервера AD.
  2. убедитесь, что » некоторые.domainName » хорошо разрешен добавьте разрешение в файл hosts для теста
  3. убедитесь, что» domainName » хорошо разрешен добавьте разрешение в файл hosts для теста
  4. убедитесь, что публичный ke центр сертификации, выдающий сертификат сервера, находится в хранилище доверенного корневого центра сертификации компьютера.
  5. попробуйте сделать так :

DirectoryEntry entry = new DirectoryEntry("LDAPS://srventr2.societe.fr:636/DC=societe,DC=fr", "user", "password");

DirectorySearcher searcher = new DirectorySearcher();
searcher.SearchRoot = entry;
searcher.SearchScope = SearchScope.Subtree;
searcher.Filter = "(&(objectCategory=person)(objectClass=user))";
SearchResultCollection results = searcher.FindAll(); 

в зависимости от того, как настроен ваш сервер каталогов(или элементы в вашей сети), иногда простое изменение, такое как это, будет работать (LDAP против LDAPS, но оставьте номер порта)

entry.Path = "LDAP://some.ldap.server:636";

Понравилась статья? Поделить с друзьями:
  • Error 064 пульсар как сбросить ошибку
  • Error 01 ошибка связи между камерой и объективом
  • Error 001100279 ансис ошибка
  • Error 000001 far cry 5 как исправить ошибку
  • Error 0 checking dll signature ошибка