Error pysvn.Client.callback_ssl_server_trust_prompt

Hi guys, I get the error pysvn.Client.callback_ssl_server_trust_prompt required when trying to commit. I understand that this is due to the trust in online verification.

Here is the documentation, I just don't get it.

 pysvn.Client.callback_ssl_server_trust_prompt import pysvn def ssl_server_trust_prompt( trust_dict ): return retcode, accepted_failures, save client = pysvn.Client() client.callback_ssl_server_trust_prompt = ssl_server_trust_prompt 

The ssl_server_trust_prompt callback is called each time the HTTPS server submits a certificate and subversion is not sure whether to trust it. callback_ssl_server_trust_prompt - with certificate information in the power of attorney.

failures - int - failure bitmask - [What do these bits mean?] Host name - string - name of the host whose certificate was submitted with finger_print - string - certificate finger print valid_from - string - valid from this date ISO8601 valid_until - string - valid ISO8601 date issuer_dname - stirng - issued domain name - string - reals pysvn expects callback_ssl_server_trust_prompt to return a tuple of three values ​​(retcode, accepted_failures, save).

retcode - boolean, False if there is no username and password. True, if subversion is to use a username and password. accepted_failures - int, accepted failures allowed save - boolean, return True, if you want subversion remember the certificate in the configuration directory. return False to prevent the certificate from being saved.

+4
source share
2 answers

When pysvn tries to perform operations on the repository that you access with https, it needs to verify the server ID. This is done by calling the callback_ssl_server_trust_prompt function. By default, this function is not defined. You, as a programmer, must provide the trust information that you do by writing a function that views the information in the trust dictionary and returns a tuple of three values ​​(described in the third paragraph of the documentation).

After you have written the function, you will make it callback_ssl_server_trust_prompt by assigning your function name to client.callback_ssl_server_trust_prompt

+6
source

I fixed a bug in documents that might be misleading regarding the value of retcode. Updated documents are in real time:

http://pysvn.tigris.org/docs/pysvn_prog_ref.html#pysvn_client_callback_ssl_server_trust_prompt

All values ​​in trust_dict are documented.

Typically, you ask the person to decide whether to trust the server certificate.

But here is the simplest function that will always accept a server certificate.

 def ssl_server_trust_prompt( trust_dict ): return (True # server is trusted ,trust_dict["failures"] ,True) # save the answer so that the callback is not called again 

Barry Scott by pysvn.

+2
source

Source: https://habr.com/ru/post/1338343/


All Articles