AWS not working with Alire - SSL Error

I am trying to make HTTPS Get requests to websites in Ada web server. I can currently do HTTP requests without issues but HTTPS fails - possibly due to SSL Certificates. I only plan on using the client portion of the Ada AWS (Ada Web Server) library.

The errors I get are raised PROGRAM_ERROR : SSL not supported. and below that is raised PROGRAM_ERROR : aws-client.adb:398 finalize/adjust raised exception. This error also happened when I repeated the process on a virtual machine of Ubuntu - I was able to build aws though. My issue with that is explained below.

I am using AWS.Client.Get(url) and am able to get a response when itā€™s HTTP. For HTTPS, it doesnā€™t work. I canā€™t find any instructions to set SSL up and how would users in future work with my application without having to download a certificate.

Even though AWS is working, when I do ā€œalr buildā€ after ā€œalr with awsā€ - I get the following :
creating s-main.tadb

Cannot create embedded resource file

make: *** [Makefile:220: gen-templates] Error 2

ERROR: Command ["make", "all", "ENABLE_SHARED=false"] exited with code 2

People on reddit said SSL should be enabled by default for the AWS crate in Alire. I tried cloning the repository and changing the Makefile config to specify ā€œopensslā€ anyway but I canā€™t figure out how to use the ā€œmakeā€ command in Windows 11. Mingw32-make doesnā€™t work and even if I did make it - I have no idea how to add this to my Ada project. Iā€™ve never used the make command or done this stuff manually as I come from a Python and Java background.

Any help is appreciated.

2 Likes

I use make in Windows a lot. I start with msys2 ( https://www.msys2.org/ ), which is what Alire uses I think. Once that is installed, I run: pacman -S make to install make. and make works good after that (I think I had to restart the shell after installing it).

1 Like

Thanks for getting back to me. I tried that and was successfully able to install make. Running ā€œalr buildā€ after doing ā€œalr with awsā€ in a fresh project still gives me this error though :

Bind
[gprbind] awsres.bexch
[Ada] awsres.ali
Link
[link] awsres.adb
make[1]: Entering directory ā€˜/c/Users/doctor/AppData/Local/alire/cache/builds/aws_24.0.0_2b75fe6d/76ffc400ad3402a54fb70c8123b2c7e3ca05994d4ebde43aa84bc3b5eaa2e888/tools/wsdl2aws-templatesā€™
ā€¦/ā€¦/.build/x86_64-w64-mingw32/debug/static/tools/awsres
-r wsdl2aws_templates
-o ā€¦/ā€¦/.build/x86_64-w64-mingw32/common/src
*.tad[sb] *.macros
AWSRes - Resource Creator v1.3

creating s-main.tadb
Cannot create embedded resource file
make[1]: *** [Makefile:20: gen-templates] Error 1
make[1]: Leaving directory ā€˜/c/Users/doctor/AppData/Local/alire/cache/builds/aws_24.0.0_2b75fe6d/76ffc400ad3402a54fb70c8123b2c7e3ca05994d4ebde43aa84bc3b5eaa2e888/tools/wsdl2aws-templatesā€™
make: *** [Makefile:220: gen-templates] Error 2
ERROR: Command [ā€œmakeā€, ā€œallā€, ā€œENABLE_SHARED=falseā€] exited with code 2

Thatā€™s not a Make error in and of itself. it is saying that line 20 of the Makefile is failing I think. So one of the commands is failling (whatever is trying to generate s-main.tadb)

Ohh I see. Is there a way of locating that file to see what line it is or even downloading AWS in a different way without Alire?

Itā€™s usually named Makefile straight up. So I would look for that in the directory where you are building it.

Checked all the subfolders and canā€™t seem to find it. Is it possible to use a different package manager like gprbuild to do this instead? It might just be some weird alire issue Iā€™m having because even after I deleted the cached version, I still get ā€œCannot create embedded resource fileā€ and that same ā€œmakeā€ error.

Did you happen to check:
/c/Users/doctor/AppData/Local/alire/cache/builds/aws_24.0.0_2b75fe6d/76ffc400ad3402a54fb70c8123b2c7e3ca05994d4ebde43aa84bc3b5eaa2e888/tools/wsdl2aws-templates or one of its subdirectories? Take a look at the paths mentioned in the Makefile output. They are in AppData, which may not be where you are searching?

I havenā€™t built AWS myself, so I am not sure if you can do it with just a GPR file or not. My naive assumption is that the Makefile probably calls gprbuild internally, but I donā€™t know for sure.

Thanks, I did find it in one of the parent directory of that but I think at this point Iā€™m going to just give up. Appreciate the help you provided.

No problem. Sorry I wasnā€™t better help. Iā€™ve never really used AWS, so I was limited in what I could help with.

Thanks anyhow though for trying and I at least found that path so it may help me in future if I go back!

For what itā€™s worth, this is happening to me on Windows 10 too, practically the same error:

Link
   [archive]      libtools.a
   [index]        libtools.a
   [link]         awsres.adb
make[1]: Entering directory '/c/Users/Dell/AppData/Local/alire/cache/builds/aws_24.0.0_2b75fe6d/31b0bbcf12d7e2d20fc86acc68082713f9548776d81915a755f9fe0cf44f059b/tools/wsdl2aws-templates'
../../.build/x86_64-w64-mingw32/debug/static/tools/awsres \
  -r wsdl2aws_templates \
  -o ../../.build/x86_64-w64-mingw32/common/src \
  *.tad[sb] *.macros
AWSRes - Resource Creator v1.3

creating s-main.tadb
Cannot create embedded resource file
make[1]: *** [Makefile:20: gen-templates] Error 1
make[1]: Leaving directory '/c/Users/Dell/AppData/Local/alire/cache/builds/aws_24.0.0_2b75fe6d/31b0bbcf12d7e2d20fc86acc68082713f9548776d81915a755f9fe0cf44f059b/tools/wsdl2aws-templates'
make: *** [Makefile:220: gen-templates] Error 2
ERROR: Command ["make", "all", "ENABLE_SHARED=false"] exited with code 2

What is strange is that itā€™s only happening on Windows.

EDIT: Seems to be the error also mentioned on:

EDIT 2: I opened a bug report

EDIT 3: This is the workaround if you donā€™t need version 24:

[[depends-on]]
# See https://github.com/AdaCore/aws/issues/380
# and https://github.com/alire-project/alire/issues/1710
[depends-on.'case(os)'.windows]
aws = "^23.0.0"
xmlada = "^23.0.0"
gnatcoll = "^23.0.0"
[depends-on.'case(os)'.'...']
aws = "^24.0.0"
xmlada = "^24.0.0"
gnatcoll = "^24.0.0"
1 Like