Good afternoon everyone.
I hope can collaborate me.
I downloaded the binary version of the harbour Version 3.4, possessing up-to-date SSL handling,and I need it for a server http (contrib-hbhttpd) I'm doing.
So far I could (in version 3.2 harbour) make it work perfect with and without SSL, but with new certificates does not work, it says SAFE CHANNEL ERROR, or is unable to interpret new ciphers.
It works perfect with self-signed certificates Version 1 generated with openssl, but if I generate a real certificate with Let's Encrypt for example (for a real url), it does not work because it is version 3.
Ultimately, after thousand tests and compilations of new versions contrib, is that I got the entire distribution of the harbour 3.4 that already have the new contrib compiled and ready to use.
When i compile my application with harbour version 3.4 (with the updated contribs), it gives me the following errors in 2 libraries, but I do not understand how to detect where the problems are, it is therefore that Iappeal to your experience and wisdom in These themes.
Paste the compilation screen:
C:\VENTAS\Servidor_HTTP>hbmk2 servidor.prg funciones.prg
hbmk2: Procesando script local: hbmk.hbm
Harbour 3.4.0dev (cf51c11) (2017-12-20 13:44)
Copyright (c) 1999-2017, https://github.com/vszakats/harbour-core/
Compiling 'servidor.prg'...
Lines 391, Functions/Procedures 3
Generating C source output to 'C:\Users\Adrian\AppData\Local\Temp\hbmk_497nzw.di
r\servidor.c'... Done.
Compiling 'funciones.prg'...
Lines 43, Functions/Procedures 2
Generating C source output to 'C:\Users\Adrian\AppData\Local\Temp\hbmk_497nzw.di
r\funciones.c'... Done.
c:/hmg/harbour/lib/win/clang\libssl.a(ssl_lib.o):(.text+0x5a97): undefined refer
ence to `_time32'
c:/hmg/harbour/lib/win/clang\libssl.a(statem.o):(.text+0x15): undefined referenc
e to `_time32'
c:/hmg/harbour/lib/win/clang\libssl.a(ssl_sess.o):(.text+0x420): undefined refer
ence to `_time32'
c:/hmg/harbour/lib/win/clang\libssl.a(ssl_sess.o):(.text+0x987): undefined refer
ence to `_time32'
c:/hmg/harbour/lib/win/clang\libssl.a(ssl_sess.o):(.text+0x187e): undefined refe
rence to `_time32'
c:/hmg/harbour/lib/win/clang\libssl.a(s3_lib.o):(.text+0x21a8): more undefined r
eferences to `_time32' follow
c:/hmg/harbour/lib/win/clang\libcrypto.a(b_addr.o):(.text+0x2a3): undefined refe
rence to `gai_strerrorW'
c:/hmg/harbour/lib/win/clang\libcrypto.a(b_addr.o):(.text+0xb60): undefined refe
rence to `gai_strerrorW'
c:/hmg/harbour/lib/win/clang\libcrypto.a(md_rand.o):(.text+0x6b7): undefined ref
erence to `_time32'
c:/hmg/harbour/lib/win/clang\libcrypto.a(a_time.o):(.text+0x4cc): undefined refe
rence to `_time32'
c:/hmg/harbour/lib/win/clang\libcrypto.a(a_time.o):(.text+0x511): undefined refe
rence to `_time32'
c:/hmg/harbour/lib/win/clang\libcrypto.a(bn_rand.o):(.text+0x9f): undefined refe
rence to `_time32'
c:/hmg/harbour/lib/win/clang\libcrypto.a(bn_rand.o):(.text+0x29f): undefined ref
erence to `_time32'
c:/hmg/harbour/lib/win/clang\libcrypto.a(bn_rand.o):(.text+0x4a5): more undefine
d references to `_time32' follow
c:/hmg/harbour/lib/win/clang\libcrypto.a(o_time.o):(.text+0x10): undefined refer
ence to `_gmtime32'
collect2: ld returned 1 exit status
hbmk2: Error: Ejecutando enlazador. 1
gcc.exe C:/Users/Adrian/AppData/Local/Temp/hbmk_497nzw.dir/servidor.o C:/Users/A
drian/AppData/Local/Temp/hbmk_497nzw.dir/funciones.o C:/Users/Adrian/AppData/Loc
al/Temp/hbmk_497nzw.dir/hbmk_vkdh7a.o -m32 -Wl,--nxcompat -Wl,--dynamicbase -
Wl,--pic-executable,-e,_mainCRTStartup -mconsole -Wl,--start-group -Wl,-Bstatic
-lhbssl -lssl -lcrypto -lcrypt32 -lhbhttpd -lxhb -lhbwin -lpng -lhbmxml -lmxml -
lhbextern -lhbdebug -lhbvmmt -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtstd -lgtpca
-lgtwin -lgtwvt -lgtgui -lhbrdd -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -
lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainstd -lkernel
32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -liphlpapi -lwinspool -lcomctl32 -lcomdl
g32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32
-lwininet -lhbpcre2 -lhbzlib -Wl,-Bdynamic -Wl,--end-group -oservidor.exe -L
c:/hmg/harbour/lib/win/clang
I hope that someone can guide me to try to compile without errors and finally be able to prove if the application workswith SSL V3 certificates.
Now I apologise if this group is not specific problems of harbour, but don't know where recourse.
Thank you very much, greetings.
Sorry for my english..
Adrián Fernández
Buenos Aires - Argentina
Hi EDS.
In first place, thank you for answer me.
I don’t understand which dll’s you need version ¿?
Let me explain you the initial problem: I need to use hbhttpd with SSL certificates V3 made with Let’s Encrypt.
Initially i try working with:
Harbour 3.2.0dev
Mingw 4.6.2 - 32 bits.
In my pc (Windows 8.1) i have install OpenSSL V1.0.2o (32 bits). Previously i try with lower version too.
The compilation of http server program is correct (no errors), but when i execute this with a SSL Certificate V3 this happens:
Screen in the Server:
Listening on port: 8002
New connection 0x000EA224
New connection 0x000E7A7C
SSL_accept() error 1
SSL_accept() error 1
SSL accept error: 1001
SSL accept error: 1001
Close connection1 0x000E7A7C
Close connection1 0x000EA224
New connection 0x000E7A9C
New connection 0x000E7ABC
SSL_accept() error 1
SSL accept error: 1001
Close connection1 0x000E7ABC
SSL_accept() error 1
SSL accept error: 1001
Close connection1 0x000E7A9C
In PC client, in Google Chrome:
ERR_SSL_VERSION_OR_CIPHER_MISMATCH
In Harbour Client Program:
SEND
Secure cannel compatibility error
(0x80072F7D)
All this was the beginning of the problems.Then I tried compiling with the harbour 3.4 distribution and I had the compilation problems that I mentioned in earlier mail
I hope you can help me. I’m using an online translator Spanish-English to help me. Sorry !Thank you very much. Adrián
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hola Diego.
He probado con certificados autofirmados con openssl, que son Versión 1 y funciona perfecto, pero como son autofirmados existe el problema de que no tiene Certificado Raiz de confianza en las pcs clientes y da error al comunicarme (igualmente con un seteo SETOPTION se pasa por alto el error, pero no es lo que me gusta).
Por eso hice un certificado de dominio con Let’s Encrypts, pero son Version 3. Intenté generarlo V1, pero no me deja.
Por lo tanto es que comencé a luchar con el tema de actualizar el hbhttpd y el hbssl del harbour pero me da los errores de compilación que detallé originalmente.
Espero se pueda llegar a buen puerto ¡!!
Desde ya, muchas gracias Diego.
Saludos
Adrián
Hola Antonio.
Tenés razón, Let’s Encript genera TLS 1.2.
Perdón por la confusión, es que al abrir el certificado en Windows, en VERSION decía V3, por eso yo me refería a certificados V3.
La pregunta es si es posible utilizar este tipo de certificados SSL TLS 1.2 con harbour, porque en definitiva, toda mi lucha está orientada a poder compilar mi servidor http (tomado del ejemplo de hbhttpd contrib) y que pueda utilizar este tipo de certificados de seguridad.
Gracias por tu aclaración
Saludos!
Adrián
De: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] En nombre de Antonio Lima
Enviado el: miércoles, 05 de septiembre de 2018 10:03 a.m.
Para: Harbour Users
Asunto: [harbour-users] Re: HBSSL / HBHTTPD SSL V3 trouble compiling with Harbour 3.4 distribution
Disable TLS 1.0/1.1, SSLv2 and v3 because they are now considered insecure.
Letsencrypt generates TLS 1.2 certificates
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Antonio, lo he bajado y copiado en mis carpetas.
Compilé sin errores ni problemas con tu distribución pero al ejecutar pasa lo mismo:
Este sitio no puede proporcionar una conexión segura
localhost utiliza un protocolo no compatible.
ERR_SSL_VERSION_OR_CIPHER_MISMATCH
OCULTAR DETALLES
Protocolo no compatible
El cliente y el servidor no admiten un conjunto de cifrado o una versión de protocolo SSL en común.
Y desde otra aplicación de harbour que consume dicho webservice, hago un SEND con la url https://localhost:8002 y me da:
SEND
Error de compatibilidad del canal seguro
(0x80072F7D)
Si existen otras pruebas para hacer, bienvenidas. La verdad estoy perdido.
Desde ya mil gracias por vuestro tiempo.
Saludos.
Adrián
De: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] En nombre de Antonio Lima
Enviado el: miércoles, 05 de septiembre de 2018 11:32 a.m.
Para: Harbour Users
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Muy interesante el link, Diego, estuve viendo el apartado Context Setup y entiendo que puedo deshabilitar SSL para que solo utilice TLS, pero en el contexto de compilación del programita mío, cómo llevo a cabo eso, tenés alguna idea ¿?
SSL_OP_NO_SSLv2 y SSL_OP_NO_SSLv3 dónde tendría que declararlo o colocarlo ¿?
Otra vez, gracias!
Adrian
Diego, mira como queda la porción del core.prg que edité:
IF ::hConfig[ "SSL" ]
IF ::lHasSSL
SSL_init()
DO WHILE RAND_status() != 1
RAND_add( hb_randStr( 20 ) + Str( hb_MilliSeconds(), 20 ), 1 )
ENDDO
::hSSLCtx := SSL_CTX_new( HB_SSL_CTX_NEW_METHOD_TLS_SERVER )
SSL_CTX_set_options( ::hSSLCtx, hb_bitOr( HB_SSL_OP_NO_SSLv2, HB_SSL_OP_NO_SSLv3, HB_SSL_OP_NO_TLSv1 ) )
IF SSL_CTX_use_PrivateKey_file( ::hSSLCtx, ::hConfig[ "PrivateKeyFilename" ], HB_SSL_FILETYPE_PEM ) != 1
::cError := "Invalid private key file"
RETURN .F.
ENDIF
IF SSL_CTX_use_certificate_file( ::hSSLCtx, ::hConfig[ "CertificateFilename" ], HB_SSL_FILETYPE_PEM ) != 1
::cError := "Invalid certificate file"
RETURN .F.
ENDIF
ELSE
::cError := "SSL not supported"
RETURN .F.
ENDIF
ENDIF
Genero nuevamente la librería libhbhttpd.a sin problemas, pero veo que en la carpeta de librerías también hay una que es libhbhttpd.dll.a. Esa no se generó. No tengo idea como hacerlo si es que se necesitara.
Cuando pruebo de recompilar mi aplicación sigue el mismo problema lamentablemente.
Gracias de nuevo!
Abrazo
Adrián
Gracias Antonio, estoy comenzando a analizar este tema que comentas.
Luego comento.
Desde ya mil gracias.
Saludos!
Adrián
De: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] En nombre de Antonio Lima
Enviado el: miércoles, 05 de septiembre de 2018 04:16 p.m.
Para: Harbour Users
Asunto: Re: [harbour-users] Re: HBSSL / HBHTTPD SSL V3 trouble compiling with Harbour 3.4 distribution
A warning:
Antonio, leí este tema.
Lo que yo utilizo para esta prueba es un certificado que tramité a través de Let’s Encrypt para un dominio DDNS (por ejemplo xxxx.homeip.net) el cual fue verificado por dominio durante el trámite, cargando en una determinada carpeta del servidor un archivo de texto provisto por Let’s Encrypt para realizar la validación de la url.
Todos los pasos fueron completados correctamente y al final, obtuve el certificado para el dominio correspondiente.
Asumo que el certificado no tiene ningún problema.
Por lo que pude leer en lo que me enviaste, este tipo de DDNS debería funcionar sin inconvenientes.
He probado de utilizar el puerto 8002 (por defecto en el hbhttpd) pero también abrí en el servidor el 80 y recompilé el servidor para que funcione con este puerto.
Siempre obtengo el mismo resultado:
Este sitio no puede proporcionar una conexión segura
xxxx.homeip.net utiliza un protocolo no compatible.
ERR_SSL_VERSION_OR_CIPHER_MISMATCH
Bueno, espero poder seguir avanzando en esto.
Gracias Antonio
Abrazo
Adrián
De: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] En nombre de Antonio Lima
Enviado el: miércoles, 05 de septiembre de 2018 04:16 p.m.
Para: Harbour Users
Asunto: Re: [harbour-users] Re: HBSSL / HBHTTPD SSL V3 trouble compiling with Harbour 3.4 distribution
A warning:
Agrego información que pude rescatar respecto del certificado Let’s Encrypt que estoy usando para el dominio xxxx.homeip.net
Tengo el servidor con el puerto 80 abierto y ejecuté, desde una ubicación remota, el comando de openssl para chequear el certificado y la conexión con el siguiente resultado:
C:\Windows\system32>openssl s_client -connect xxxx.homeip.net:80
CONNECTED(000001A8)
14344:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:.\ssl\s23_clnt.c:802:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 307 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1536195079
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
C:\Windows\system32>
Realmente no sé si está bien o no este resultado. Si ven algo que sirva para continuar con el tema, muy agradecido.
A continuación les pego el resultado de la ejecución del mismo comando para un dominio que tiene un certificado Let’s Encrypt funcionando en un Hosting (www.arcopi.com.ar) y creo que da el mismo resultado que el anterior que uso para las pruebas:
C:\Users\Adrian>openssl s_client -connect www.arcopi.com.ar:80
CONNECTED(000001A0)
25276:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:.\ssl\s23_clnt.c:827:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 307 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1536195814
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
Saludos!
Adrián
De: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] En nombre de Antonio Lima
Enviado el: miércoles, 05 de septiembre de 2018 04:16 p.m.
Para: Harbour Users
Asunto: Re: [harbour-users] Re: HBSSL / HBHTTPD SSL V3 trouble compiling with Harbour 3.4 distribution
A warning:
Diego / Antonio
Logré que funcione ¡!!!!!!, no hubiera sido posible sin su valiosa ayuda, desde ya les agradezco enormemente todo el tiempo que se tomaron para analizar el problema y ayudarme paso a paso a resolver.
En base a todas las pistas que me iban dando, fui analizando, descartando y llegué a la conclusión que el problema era el certificado Let’s Encrypt.
Me puse a crear nuevamente el certificado y al final funcionó ¡!!.
Les comento que probé dicho certificado con el hbhttpd de la distribución original 3.2.0dev de harbour y también funciona.
Igualmente, para estar más seguro, voy a realizar muchas pruebas con la distribución original y con las librerías originales de dicha distribución. Les voy comentando.
GRACIAS GRACIAS
THANK YOU SO MUCH ¡!!
Abrazo
Adrián
De: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] En nombre de Antonio Lima
Enviado el: miércoles, 05 de septiembre de 2018 11:31 p.m.
Para: Harbour Users
Asunto: Re: [harbour-users] Re: HBSSL / HBHTTPD SSL V3 trouble compiling with Harbour 3.4 distribution
Hi,
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/gHEnmT5KSMc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.