Olivier,
you are right.
It is not an erlang problem. There is something amiss with RedHat distribution.
I tested with ubuntu and it is fine:

$ cat /etc/issue
Ubuntu 12.04.2 LTS \n \l

$ openssl version
OpenSSL 1.0.1 14 Mar 2012

$ erl
Erlang R16B03 (erts-5.10.4) [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.4  (abort with ^G)
1> m(crypto).
Module crypto compiled: Date: December 9 2013, Time: 19.33
Compiler options:  [{d,'CRYPTO_VSN',"3.2"},
                    {outdir,"/net/isildur/ldisk/daily_build/r16b03_prebuild_opu_o.2013-12-09_20/otp_src_R16B03/lib/crypto/src/../ebin"},
                    warnings_as_errors,warn_obsolete_guard,debug_info]
Object file: /usr/local/lib/erlang/lib/crypto-3.2/ebin/crypto.beam
Exports:
aes_cbc_128_decrypt/3         hmac_update/2
aes_cbc_128_encrypt/3         info/0
aes_cbc_256_decrypt/3         info_lib/0
... abridged ...

So i will just switch to ubuntu 12.

Thanks and regards,
Takeshi


On Tue, Dec 17, 2013 at 8:19 AM, Olivier Girondel <olivier.girondel@gmail.com> wrote:
Yep, I just got this very same problem installing R16B02 on RHEL6 (damned distro :)
A very crude patch is to patch eg
otp_src_R16B03/lib/crypto/c_src/crypto.c
and commenting the # define HAVE_EC line
Recompile erlang, try application:start(crypto). and check you're set
I repeat, this is the ugliest way of fixing things :) But if you're in the same case where you don't need elliptic curves stuff, that's a fix(c)(r)(tm)
I wouldn't bother the OTP team on this, rather it seems that redhat/centos/whatever packages are broken/out of date.
Never had this kind of problem with eg Debian
Hope this helps,


On Mon, Dec 16, 2013 at 11:55 PM, mayamatakeshi <mayamatakeshi@gmail.com> wrote:
All,
thanks for the directions.
Actually, it is not a problem with yaws.
Checking how HAVE_CRYPTO_HASH is resolved, i got that erlang itself is failing to load crypto lib:

# erl
Erlang R16B03 (erts-5.10.4) [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.4  (abort with ^G)
1> m(crypto).
** exception error: undefined function crypto:module_info/0
     in function  c:m/1 (c.erl, line 503)
2>
=ERROR REPORT==== 17-Dec-2013::07:25:59 ===
Unable to load crypto library. Failed with error:
"load_failed, Failed to load NIF library: '/usr/local/lib/erlang/lib/crypto-3.2/priv/lib/crypto.so: undefined symbol: EC_GROUP_new_curve_GF2m'"
OpenSSL might not be installed on this system.

=ERROR REPORT==== 17-Dec-2013::07:25:59 ===
The on_load function for module crypto returned {error,
                                                 {load_failed,
                                                  "Failed to load NIF library: '/usr/local/lib/erlang/lib/crypto-3.2/priv/lib/crypto.so: undefined symbol: EC_GROUP_new_curve_GF2m'"}}


However, I have openssl-devel installed:

# yum install openssl-devel
Loaded plugins: security
Setting up Install Process
Package openssl-devel-1.0.1e-16.el6_5.x86_64 already installed and latest version
Nothing to do


So it seems EC_GROUP_new_curve_GF2m is not present in openssl libs anymore and crypto is not available.

Checking further,
erlang/crypto installation was fine with CentOS 6.4 some time ago.
Then recently CentOS  6.5 arrived and it updated openssl-devel from:
openssl-devel.x86_64                  1.0.0-27.el6_4.2
to:
openssl-devel.x86_64                  1.0.1e-16.el6_5

And it seem EC_GROUP_new_curve_GF2m is not present on the new version.
So, if you upgrade CentOS 6.x to latest 6.5 (or if you just upgrade openssl-devel to v. 1.0.1e-16.el6_5), then crypto will not load anymore because EC_GROUP_new_curve_GF2m is missing.

So this has nothing to do with yaws. I will report this to erlang devs.

Regards,
Takeshi




On Tue, Dec 17, 2013 at 12:01 AM, Patrick Moy <ptmoy2@gmail.com> wrote:
I ran into this same problem with yaws 1.97 and Ubuntu, and had to change a file in yaws to get rid of the problem.  But this should have been fixed in yaws 1.98.  I successfully compiled yaws 1.98 a few days ago using yaws-1.98.tar.gz file downloaded from here: http://yaws.hyber.org/download/.  Is this the tar ball you're using?




On Mon, Dec 16, 2013 at 4:20 AM, Christopher Faulet <christopher.faulet@capflam.org> wrote:
On 16/12/2013 01:59, mayamatakeshi wrote:
> I am using:
> Erlang R16B03 (erts-5.10.4) [source] [64-bit] [async-threads:10] [hipe]
> [kernel-poll:false]
>
> I tried with CentOS 6.4 and 6.5 and in both I get this:
>
> "/usr/local/bin/erlc" -Werror  -pa ../../yaws -I ../include -o ../ebin
> yaws_websockets.erl
> compile: warnings being treated as errors
> yaws_websockets.erl:1258: crypto:sha/1 is deprecated and will be removed
> in in a future release; use crypto:hash/2
> make[1]: *** [../ebin/yaws_websockets.beam] Error 1
> make[1]: Leaving directory `/usr/local/src/yaws-1.98/src'
> make: *** [all] Error 1
>

Hi,

Maybe you need to re-run the configure script. And to be sure, you also
could regenerate this script by running following command:

 autoreconf -fi

If crypto:hash/2 is found, HAVE_CRYPTO_HASH variable must be set to true
in include.mk.

Let me know if your problem persist.
--
Christopher



------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list



------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list



------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list




--
Olivier