This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!

Sarah Jay

Ranch Hand
+ Follow
since Dec 10, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
5
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sarah Jay

Sarah Jay wrote:

Kristina Hansen wrote:according to wikipedia LDAP over SSL/TLS (LDAPS) has its own port - so if you somehow have to filter between unsecure and secure I would go for check for port number



Thanks Kristina..

Do we have any other way apart from port check filter .. Because even though the port changes it should work fine that is the actuall Problem.  I wanted something like this..


or

Can we do with regex like this?



Note: I am just concentrating on protocol here.[ldap/ldaps, bothe should work fine.]

Which is the correct and Best one?





Did Anyone used any of the above approaches...Could you please answer
13 hours ago

Kristina Hansen wrote:according to wikipedia LDAP over SSL/TLS (LDAPS) has its own port - so if you somehow have to filter between unsecure and secure I would go for check for port number



Thanks Kristina..

Do we have any other way apart from port check filter .. Because even though the port changes it should work fine that is the actuall Problem.  I wanted something like this..


or

Can we do with regex like this?



Note: I am just concentrating on protocol here.[ldap/ldaps, bothe should work fine.]

Which is the correct and Best one?
17 hours ago
Now I wanted to support both ldap and ldaps ..Can I do with regular expressions ...Or what is the way and it should not depend on port number.

Kindly suggest how can we achieve it in Java code.

Thanks.
19 hours ago

Bear Bibeault wrote:In your first example the keys are numbers, not strings. In the second case they are strings. The second case works because you are using the strings from phone_num as the indexes, not numbers.



Thanks, Bear...

You mean to say I should not cast it to list then it will work fine...I have tried that too...It dint worked for me...Could you please explain to me little in a little bit clearer way...
1 week ago
Hi All,

As per my understanding if we have not defined the value in dictionary then we will get the None. But am getting none even though if the value is defined. Could anyone explain to me the below scenario?



And the out put is:


Enter the phone number12343
['1', '2', '3', '4', '3']
Three
None
None
None
None
None



And I will get it worked when I put the keys of dictionaries inside the quotes as below:


So, is it mandatory to use quotes for keys?
1 week ago
Ok Thank you So much Stephan.

I will make changes without SSL with a change in LDAP to ldaps in the URL.
1 week ago

Instead of requesting the use of SSL via the use of the Context.SECURITY_PROTOCOL property, you can also request the use of SSL via the use of LDAPS URLs.


I think this statement leaves little open to interpretation.

Thank you so much Stephan.

So now for LDAPS we should use SSL for both ways..... Either it might be  Context.SECURITY_PROTOCOL  or For URL change.. SSL certificate is mandatory ...Correct me if am wrong.. Am little confused..

And if I have to use SSL certificates could you please give me an Idea how can I do it...As I am new to this topic I have been reading some articles but still I am not sure How to do it...


1 week ago
Hi,

Could anyone help on how to switch from LDAP to LDAPS.
I read this Article : https://docs.oracle.com/javase/tutorial/jndi/ldap/ssl.html

What I got is either we can add below piece of code and use certificate


OR we can make the changes in LDAP URL That is ldap to ldaps

as mentioned below:



And could anyone say me that will we use SSL for LDAP also..? OR we will use ssl certificates inly for SECURE LDAPS connection.

Is it enough if I change in the URL?
1 week ago
Hi Can anyone help me to print the below pattern.

A P Q R
A B Q R
A B C R
A B C D

I am able to print the half diagonal using the below logic;



And being able to get the below output:
A
A B
A B C
A B C D

3 weeks ago

Tim Holloway wrote:Python was not originally designed as an object-oriented language, and like other retro-fit OOP implementations, it has warts.

In Python's case, since a function is essentially procedure-oriented, there's no "self" or "this" keyword implicit in the language and thus when you declare a class member method, you have to explicitly define a variable (conventionally named "self") to hold the instance reference.

On the other hand, the Python compiler does have enough OOP-awareness to know that if you code a "x.y(a, b, c)" function call, then the "x" part should be passed as the "self" parameter and and the "a, b, c" valies are then appended to the parameter list.



Thanks Tim. Still, I have doubts like when to use self or more precisely I can ask as when to use Static methods , instance methods and class methods.

Basically I am aware of static methods. But why do we have class methods again
4 weeks ago

Stephan van Hulst wrote:Yes. On Windows you can use PowerShell. I think you could use the following command, but I haven't tried it out myself:

Obviously, you need to replace the value of the -DnsName parameter.
Also take a look at these links:

  • How to enable LDAP over SSL with a third-party certification authority
  • New-SelfSignedCertificate
  • Generating self-signed certificates on Windows


  • Thank you so much, Stephan.I will go through all the links you have provided and if any doubts I will post it.
    4 weeks ago
    Hi All,

    After googling  I got to know that I should call it:



    Instead of :


    And I got the expected result. But as per my understanding, we need not pass the self argument while calling the method.

    Can anyone help me on this?
    4 weeks ago
    Hi All,

    I am aware that we will use the super() method in the below scenario:

    To access a member of the base class from within its derived class, in the case when this base class member has the same name as a member of its derived class, we can use the super() function with the dot operator.

    And we can use the super method in two ways:
    1. In Python 3 and above, the syntax for super is:

    super().methoName(args)

    2.(in older builds of Python):

    super(subClass, instance).method(args)


    Now I am writing the below code and it is working fine for me. But I guess we can also access the superclass members using a fully qualified name.



    Output is:
    From Method A
    10


    But When I use fully qualified name as follows I am facing the error:




    Error:



    4 weeks ago

    Stephan van Hulst wrote:You can get a certificate from any CA. You can even create a certificate yourself, although you must only use such a certificate for development purposes, not for a live domain controller.

    For a production environment, what CA to use kinda depends on who will be accessing the domain controller. For instance, if you only want to use LDAPS within a company intranet, you can setup a CA for your own company, and add its root certificate to the trusted certificates of all systems within your company intranet. Then you request a certificate from your own CA as outlined here. Install the certificate in the domain controller's personal certificate store. Active Directory will now use this certificate to identify itself when accessing it through LDAPS. Systems in your intranet will authenticate the domain controller's identity by verifying that its certificate was issued by your company's CA, which they trust.

    If you need more help, you need to give us details like what kind of applications will be using LDAP, whether the domain controller will only be accessible in the intranet, and if so, why you want to secure it.



    Thanks, Stephan.

    I want your help in generating the certificate in a test environment.
    I am aware that we can generate it using OpenSSL command...But I don't have knowledge like how can I create using OpenSSL I mean what is the procedure...
    Do we require any tool or App to be installed in our system to generate the SSL certificate?

    Thanks for your help...
    4 weeks ago


    am new to LDAP / Active Directory environment.

    am trying to connect with LDAP / Active Directory using SSL support.

    to connect LDAP/Active Directory, SSL certificate is required to establish the connection.

    I have been googling, and most of the result is to "create a certificate using Microsoft CA (certificate authority)". Is this is the only way to generate a certificate for LDAP/Active Directory?

    How can i get SSL Certificate for LDAP / Active Directory? Is there any other way to get the SSL Certificate for LDAP/Active Directory?
    1 month ago