<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.fr.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>15 Nov 2018 09:20:40 Z</lastBuildDate><pubDate>15 Nov 2018 09:00:52 Z</pubDate><description>Bonjour,&#13;
&#13;
Je consomme depuis mon appli windev des webservices qui sont passés en https, avec certificat autosigné. (via soapExecute avec des xmls construits à la main)&#13;
Du coup maintenant, impossible de les appeler, chaque fois je me prends le message :&#13;
&#13;
"Alerte de sécurité : le certificat de ce site n'a pas été émis par une société reconnue ou à laquelle vous avez choisi de faire confiance"&#13;
&#13;
On m'a dit qu'il fallait utiliser du coup un TrustManager qui accepte les certificats autosignés.. exemple de code en java : &#13;
&#13;
[code:java]&#13;
protected void initClientWebServiceHTTPS() throws Exception {&#13;
        // Create a trust manager that does not validate certificate chains&#13;
        TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {&#13;
            @Override&#13;
            public java.security.cert.X509Certificate[] getAcceptedIssuers() {&#13;
                return null;&#13;
            }&#13;
&#13;
            @Override&#13;
            public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {&#13;
                // TODO Auto-generated method stub&#13;
            }&#13;
&#13;
            @Override&#13;
            public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {&#13;
                // TODO Auto-generated method stub&#13;
            }&#13;
        } };&#13;
&#13;
        // Install the all-trusting trust manager&#13;
        SSLContext sc = SSLContext.getInstance("SSL");&#13;
        sc.init(null, trustAllCerts, new java.security.SecureRandom());&#13;
        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());&#13;
&#13;
        // Create all-trusting host name verifier&#13;
        HostnameVerifier allHostsValid = new HostnameVerifier() {&#13;
            @Override&#13;
            public boolean verify(String hostname, SSLSession session) {&#13;
                return true;&#13;
            }&#13;
        };&#13;
&#13;
        // Install the all-trusting host verifier&#13;
        HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);&#13;
&#13;
        URL url = new URL("https://" + WSTechnique.getServeurHttpHostName() + ":" + WSTechnique.getServeurHttpPort()&#13;
        + "/WebServiceCompta?wsdl");&#13;
        HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();&#13;
        connection.setHostnameVerifier(allHostsValid);&#13;
        // then initiate the service&#13;
&#13;
        this.webServiceComptaMTOM = new InterfaceWSComptaMTOMImplService(&#13;
                new URL("https://" + WSTechnique.getServeurHttpHostName() + ":" + WSTechnique.getServeurHttpPort()&#13;
                + "/WebServiceCompta?wsdl"),&#13;
                new QName("http://magnus.egf.webservicecompta", "InterfaceWSComptaMTOMImplService"));&#13;
&#13;
        final HeaderHandlerResolver handlerResolver = new HeaderHandlerResolver();&#13;
        this.webServiceComptaMTOM.setHandlerResolver(handlerResolver);&#13;
    }&#13;
&#13;
[/code]&#13;
&#13;
Mais euuh... y'a-t'il moyen d'arriver au meme résultat depuis une appli windev ? :(</description><ttl>30</ttl><generator>WEBDEV</generator><language>fr_FR</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/221957-appel-webservice-https/read.awp</link><title>Appel de webservice en Https</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>Jsoft</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/221957-appel-webservice-https-221958/read.awp</comments><pubDate>15 Nov 2018 09:20:40 Z</pubDate><description>Ignorer le certificat avec ..IgnoreErreur=httpIgnoreCertificatInvalide ?&#13;
&#13;
--&#13;
Tous nos logiciels sur https://www.jsoft.fr/</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/221957-appel-webservice-https-221958/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/221957-appel-webservice-https-221958/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/221957-appel-webservice-https/read.awp">Appel de webservice en Https</source><title>Re: Appel de webservice en Https</title></item></channel></rss>
