Pharo 7, Iceberg, Proxy and Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Pharo 7, Iceberg, Proxy and Windows

Vitor Medina Cruz
Hello,

Iceberg fail to function behind a proxy on Pharo 7 32bits Windows. When I try to clone I get a:

IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation

I had a similar problem some time ago with Pharo 6, in which I made a local hot fix after questioning here. The fix was to the LGitCloneOptions and LGitFetchOptions both at the initializeWithDefaults, currently this method on LGitCloneOptions is like this:


initializeWithDefaults
    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto


The bold is the fix, but it should come first in the method:

initializeWithDefaults
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto

    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].


That way worked on Pharo 6, but now I got a:

"FFIVariableNameNotFound: Could not find accessor for variable named 'out'"

Any clues?

Regards,
Vitor
Reply | Threaded
Open this post in threaded view
|

Re: Pharo 7, Iceberg, Proxy and Windows

Vitor Medina Cruz
Ok, I forgot to mention I have changed LGitRepository>>clone:url:local_path:options:, but for some odd reason it's arguments names were switched to arg 1, arg2, arg3 etc, so the out error was because was renamed to one of those generic arg names. I figure that out looking at the versions of the methods, and it apers that when I first access it this change is made.

Anyways, I fixed that and I still get "IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation"

On Wed, Jun 20, 2018 at 4:49 PM, Vitor Medina Cruz <[hidden email]> wrote:
Hello,

Iceberg fail to function behind a proxy on Pharo 7 32bits Windows. When I try to clone I get a:

IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation

I had a similar problem some time ago with Pharo 6, in which I made a local hot fix after questioning here. The fix was to the LGitCloneOptions and LGitFetchOptions both at the initializeWithDefaults, currently this method on LGitCloneOptions is like this:


initializeWithDefaults
    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto


The bold is the fix, but it should come first in the method:

initializeWithDefaults
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto

    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].


That way worked on Pharo 6, but now I got a:

"FFIVariableNameNotFound: Could not find accessor for variable named 'out'"

Any clues?

Regards,
Vitor

Reply | Threaded
Open this post in threaded view
|

Re: Pharo 7, Iceberg, Proxy and Windows

Vitor Medina Cruz
I am sorry, the correct message is "LGit_GIT_ERROR: failed to get server certificate: The handle is in the wrong state for the requested operation".


I tried to add corporate certificates to the git curl-ca-bundle.crt, I tried to git config --global http.sslVerify false also, no success... :(

On Thu, Jun 21, 2018 at 9:31 AM, Vitor Medina Cruz <[hidden email]> wrote:
Ok, I forgot to mention I have changed LGitRepository>>clone:url:local_path:options:, but for some odd reason it's arguments names were switched to arg 1, arg2, arg3 etc, so the out error was because was renamed to one of those generic arg names. I figure that out looking at the versions of the methods, and it apers that when I first access it this change is made.

Anyways, I fixed that and I still get "IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation"

On Wed, Jun 20, 2018 at 4:49 PM, Vitor Medina Cruz <[hidden email]> wrote:
Hello,

Iceberg fail to function behind a proxy on Pharo 7 32bits Windows. When I try to clone I get a:

IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation

I had a similar problem some time ago with Pharo 6, in which I made a local hot fix after questioning here. The fix was to the LGitCloneOptions and LGitFetchOptions both at the initializeWithDefaults, currently this method on LGitCloneOptions is like this:


initializeWithDefaults
    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto


The bold is the fix, but it should come first in the method:

initializeWithDefaults
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto

    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].


That way worked on Pharo 6, but now I got a:

"FFIVariableNameNotFound: Could not find accessor for variable named 'out'"

Any clues?

Regards,
Vitor


Reply | Threaded
Open this post in threaded view
|

Re: Pharo 7, Iceberg, Proxy and Windows

Vitor Medina Cruz
How do you debug and/or log what's happening inside Libgit? I think I will have to look deep into it to understand what is the problem.

On Thu, Jun 21, 2018 at 12:48 PM, Vitor Medina Cruz <[hidden email]> wrote:
I am sorry, the correct message is "LGit_GIT_ERROR: failed to get server certificate: The handle is in the wrong state for the requested operation".


I tried to add corporate certificates to the git curl-ca-bundle.crt, I tried to git config --global http.sslVerify false also, no success... :(

On Thu, Jun 21, 2018 at 9:31 AM, Vitor Medina Cruz <[hidden email]> wrote:
Ok, I forgot to mention I have changed LGitRepository>>clone:url:local_path:options:, but for some odd reason it's arguments names were switched to arg 1, arg2, arg3 etc, so the out error was because was renamed to one of those generic arg names. I figure that out looking at the versions of the methods, and it apers that when I first access it this change is made.

Anyways, I fixed that and I still get "IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation"

On Wed, Jun 20, 2018 at 4:49 PM, Vitor Medina Cruz <[hidden email]> wrote:
Hello,

Iceberg fail to function behind a proxy on Pharo 7 32bits Windows. When I try to clone I get a:

IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation

I had a similar problem some time ago with Pharo 6, in which I made a local hot fix after questioning here. The fix was to the LGitCloneOptions and LGitFetchOptions both at the initializeWithDefaults, currently this method on LGitCloneOptions is like this:


initializeWithDefaults
    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto


The bold is the fix, but it should come first in the method:

initializeWithDefaults
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto

    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].


That way worked on Pharo 6, but now I got a:

"FFIVariableNameNotFound: Could not find accessor for variable named 'out'"

Any clues?

Regards,
Vitor



Reply | Threaded
Open this post in threaded view
|

Re: Pharo 7, Iceberg, Proxy and Windows

EstebanLM
hi,

On 22 Jun 2018, at 15:01, Vitor Medina Cruz <[hidden email]> wrote:

How do you debug and/or log what's happening inside Libgit? I think I will have to look deep into it to understand what is the problem.

I put a breakpoint in the function I want to start debugging.

Esteban


On Thu, Jun 21, 2018 at 12:48 PM, Vitor Medina Cruz <[hidden email]> wrote:
I am sorry, the correct message is "LGit_GIT_ERROR: failed to get server certificate: The handle is in the wrong state for the requested operation".


I tried to add corporate certificates to the git curl-ca-bundle.crt, I tried to git config --global http.sslVerify false also, no success... :(

On Thu, Jun 21, 2018 at 9:31 AM, Vitor Medina Cruz <[hidden email]> wrote:
Ok, I forgot to mention I have changed LGitRepository>>clone:url:local_path:options:, but for some odd reason it's arguments names were switched to arg 1, arg2, arg3 etc, so the out error was because was renamed to one of those generic arg names. I figure that out looking at the versions of the methods, and it apers that when I first access it this change is made.

Anyways, I fixed that and I still get "IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation"

On Wed, Jun 20, 2018 at 4:49 PM, Vitor Medina Cruz <[hidden email]> wrote:
Hello,

Iceberg fail to function behind a proxy on Pharo 7 32bits Windows. When I try to clone I get a:

IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation

I had a similar problem some time ago with Pharo 6, in which I made a local hot fix after questioning here. The fix was to the LGitCloneOptions and LGitFetchOptions both at the initializeWithDefaults, currently this method on LGitCloneOptions is like this:


initializeWithDefaults
    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto


The bold is the fix, but it should come first in the method:

initializeWithDefaults
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto

    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].


That way worked on Pharo 6, but now I got a:

"FFIVariableNameNotFound: Could not find accessor for variable named 'out'"

Any clues?

Regards,
Vitor




Reply | Threaded
Open this post in threaded view
|

Re: Pharo 7, Iceberg, Proxy and Windows

Guillermo Polito
In reply to this post by Vitor Medina Cruz
Hi Vitor,

I've created an issue with your problem.


I encourage you to do so too, because following the mailing list is sometimes hard :)

About your second issue, you should know that libgit (libgit2.github.com/libgit2) will mostly bypass git and reimplement most of its features.
So, most of the times it will read git's settings, and some other times not.
And also there is the possibility that Iceberg overrides those settings too.

For example, your fix

self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto

does enable automatic proxy verification and forbids people to set their own proxy.
Not saying that this is bad but the contrary: I think it is a really good default value :).

Similar to that there are the ssh verifications on Iceberg. So far
 - we do not check the certificate stores from the machine (we could through FFI, the sub-project is listed in here https://github.com/pharo-vcs/iceberg/wiki/How-to-help-us,-What-you-could-contribute)
 - I don't think so far there is a hook to "disable ssh verification". This could be dangerous...

I've googled the error a bit, and found this. Maybe you can try it and see wether the solution belongs to iceberg, or that we should enhance the documentation?


Tx,
Guille

On Thu, Jun 21, 2018 at 5:49 PM Vitor Medina Cruz <[hidden email]> wrote:
I am sorry, the correct message is "LGit_GIT_ERROR: failed to get server certificate: The handle is in the wrong state for the requested operation".


I tried to add corporate certificates to the git curl-ca-bundle.crt, I tried to git config --global http.sslVerify false also, no success... :(

On Thu, Jun 21, 2018 at 9:31 AM, Vitor Medina Cruz <[hidden email]> wrote:
Ok, I forgot to mention I have changed LGitRepository>>clone:url:local_path:options:, but for some odd reason it's arguments names were switched to arg 1, arg2, arg3 etc, so the out error was because was renamed to one of those generic arg names. I figure that out looking at the versions of the methods, and it apers that when I first access it this change is made.

Anyways, I fixed that and I still get "IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation"

On Wed, Jun 20, 2018 at 4:49 PM, Vitor Medina Cruz <[hidden email]> wrote:
Hello,

Iceberg fail to function behind a proxy on Pharo 7 32bits Windows. When I try to clone I get a:

IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation

I had a similar problem some time ago with Pharo 6, in which I made a local hot fix after questioning here. The fix was to the LGitCloneOptions and LGitFetchOptions both at the initializeWithDefaults, currently this method on LGitCloneOptions is like this:


initializeWithDefaults
    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto


The bold is the fix, but it should come first in the method:

initializeWithDefaults
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto

    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].


That way worked on Pharo 6, but now I got a:

"FFIVariableNameNotFound: Could not find accessor for variable named 'out'"

Any clues?

Regards,
Vitor




--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: Pharo 7, Iceberg, Proxy and Windows

Vitor Medina Cruz
Thanks Guille, will do that on further occasions, I just got excited to make it work for me :)

I had see the page you sent already, but git works fine in any other program here (eg. command line, Intellij and Sourcetree) so I don't think the problem here is related to what was described by the stackoverflow page (and, well, I don't have admin rights in this machine, so I am unable to apply the proposed patch  :(  ).

Anyways, I will try to use Iceberg only for commit/fetch and make the pull/push from command line.

Regards,
Vitor


On Mon, Jun 25, 2018 at 6:23 AM, Guillermo Polito <[hidden email]> wrote:
Hi Vitor,

I've created an issue with your problem.


I encourage you to do so too, because following the mailing list is sometimes hard :)

About your second issue, you should know that libgit (libgit2.github.com/libgit2) will mostly bypass git and reimplement most of its features.
So, most of the times it will read git's settings, and some other times not.
And also there is the possibility that Iceberg overrides those settings too.

For example, your fix

self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto

does enable automatic proxy verification and forbids people to set their own proxy.
Not saying that this is bad but the contrary: I think it is a really good default value :).

Similar to that there are the ssh verifications on Iceberg. So far
 - we do not check the certificate stores from the machine (we could through FFI, the sub-project is listed in here https://github.com/pharo-vcs/iceberg/wiki/How-to-help-us,-What-you-could-contribute)
 - I don't think so far there is a hook to "disable ssh verification". This could be dangerous...

I've googled the error a bit, and found this. Maybe you can try it and see wether the solution belongs to iceberg, or that we should enhance the documentation?


Tx,
Guille

On Thu, Jun 21, 2018 at 5:49 PM Vitor Medina Cruz <[hidden email]> wrote:
I am sorry, the correct message is "LGit_GIT_ERROR: failed to get server certificate: The handle is in the wrong state for the requested operation".


I tried to add corporate certificates to the git curl-ca-bundle.crt, I tried to git config --global http.sslVerify false also, no success... :(

On Thu, Jun 21, 2018 at 9:31 AM, Vitor Medina Cruz <[hidden email]> wrote:
Ok, I forgot to mention I have changed LGitRepository>>clone:url:local_path:options:, but for some odd reason it's arguments names were switched to arg 1, arg2, arg3 etc, so the out error was because was renamed to one of those generic arg names. I figure that out looking at the versions of the methods, and it apers that when I first access it this change is made.

Anyways, I fixed that and I still get "IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation"

On Wed, Jun 20, 2018 at 4:49 PM, Vitor Medina Cruz <[hidden email]> wrote:
Hello,

Iceberg fail to function behind a proxy on Pharo 7 32bits Windows. When I try to clone I get a:

IceGenericError: failed to get server certificate: The identifier is not in the correct state for the resquested operation

I had a similar problem some time ago with Pharo 6, in which I made a local hot fix after questioning here. The fix was to the LGitCloneOptions and LGitFetchOptions both at the initializeWithDefaults, currently this method on LGitCloneOptions is like this:


initializeWithDefaults
    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto


The bold is the fix, but it should come first in the method:

initializeWithDefaults
    self prim_fetch_opts prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto

    self withReturnHandlerDo: [
        self
            clone_init_options: self
            version: LGitOptionsVersionsEnum  git_clone_options_version_1 ].


That way worked on Pharo 6, but now I got a:

"FFIVariableNameNotFound: Could not find accessor for variable named 'out'"

Any clues?

Regards,
Vitor




--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13